Custom parameters

Custom parameters can be added to the URL passed to the content rendering service. These parameters can then be referenced from within your handlebars templates, allowing you to implement different functionality based on variables such as locale or device, for example.

The params are included in the URL query parameters as follows:


With an example full URL for a content item:

The content rendering service includes a crParam namespace that contains the custom parameters. In the example above we are passing 'device' and 'account' parameters.

To access the custom parameters use the crParams helper, as shown below:

{{crParam 'device' .}}
{{#if (crParam 'device' .)}}

An example handlebars template that displays the result of a 'device' and 'account' custom parameter is shown below. You would access your own parameters from crParam as shown in the example.

<h1>Passed params template</h1>

<p>Query string parameters can be passed to handlebars templates using the crParam namespace:</p>

{{#if (crParam 'account' .)}}
    <h2>Passed param: account</h2>
  <p>{{crParam 'account' .}}</p>

{{#if (crParam 'device' .)}}
    <h2>Passed param: device</h2>
  <p>{{crParam 'device' .}}</p>