WebMake: Documentation: ${content_refs} - References to Content Chunks

WebMake Documentation (version 2.3) | [ Back | Forward | Index | All In One ]

# ${content_refs} - References to Content Chunks Content chunks and variables can be referred to using this format. This is evaluated before any other variable reference is. ${name} Content chunks can refer to other chunks, URLs, or use deferred references, up to 30 levels deep. ### Default Values If you wish to refer to a content item or variable, but are not sure if it exists, you can provide a default value by following the content name with a question mark and the default value. ${name?defaultvalue} ### Parameterized References Content references can also be parameterised references; this means that they act like function calls, in a way, allowing you to pass in parameters. They look like this: ${name: parameter="value" ...} The parameters are declared in the XML style. Note: the parameters' values must not contain further content references, due to a limitation in the way WebMake parses content refs. If you want to refer to a content item from within a template, pass in the name of the content item, and get the template to expand it; see the example below. For example, if you set up a template item like this:
    	<template name="mytemplate">
    		You passed in ${name}, and its value is \"${${name}}\".
    	</template>
and a content item like this:
    	<content name="foo">
    		Hi, I'm foo!
    	</content>
Then a reference to: ${mytemplate: name="foo"} will expand to: **You passed in foo, and its value is \"Hi, I'm foo!\".

WebMake Documentation (version 2.3) | [ Back | Forward | Index | All In One ]