How do I build a content block with variables?
A content block is a piece of HTML you show in several places of your customer pages: above the calendar, in the steps of the booking dialog, in a menu, or as the header and footer of a theme. A block is a Smarty template. Besides plain HTML you can use variables ({$prod_desc}) and tags ({ext mod="menu" id="…"}). This lets you build one block that shows the right name, photo and characteristics for every product.
The side panel in the editor
Open a content block via Configuration > Customer Page > Content Pages > Content Block. Next to the editor you see:
- Used on — every calendar, dialog step, menu, theme and widget that shows this block.
- Product variables and combi variables — per group the places where they are filled and where they stay empty.
- Tags — ready-made examples of tags that work in any block.
Click a variable or tag to insert it at the cursor, in the source code as well as in the visual editor.
Where are the variables filled?
A variable only has a value where a product is known:
| Place | Filled variables |
|---|---|
| Calendar and the options, questions, participants, players and extra fields steps | Product and, for a combi, combi |
| Native widget (content block per product) | Product |
| Index, login, checkout, menu, theme header/footer and other pages | No product variables — they stay empty |
Is the same block shown in both kinds of places? The side panel then warns that the product variables stay empty in part of them.
Example: product introduction above the calendar
<div class="product-intro">
<img src="{$object_image}" alt="{$prod_desc}" class="img-fluid">
<h3>{$prod_desc}</h3>
{$obj_long_desc nofilter}
<p>Geschikt voor: {$obj_txt_custom03|default:"alle leeftijden"}</p>
</div>{$object_image}is the web address of the default image of the product, so put it in an<img src="…">.- Long texts such as
{$obj_long_desc}contain HTML. Addnofilter, otherwise the HTML code shows as text. The side panel does this for you. |default:"…"shows a fixed text when the characteristic is empty.
Example: characteristic (yes/no)
{if $obj_chk_custom01}
<p class="alert alert-info">Rolstoeltoegankelijk</p>
{/if}Example: parts of a combi
<h3>{$combi_desc}</h3>
<ul>
{foreach $combidetail as $combidetailrow}
<li>{$combidetailrow.obj_desc}</li>
{/foreach}
</ul>Check on save
The block is checked when you save it. It is not saved when it contains:
- an error in the template, for example an
{if}without{/if}or an unknown tag; - variables written the email template way, such as
{OBJ_DESC}. In a content block use{$obj_desc}: the names are the same, only the notation differs; - parts that are not allowed for security reasons, such as server settings or loading files.
A tag meant for internal use only (such as {seo}) is saved with a warning.
Content block in the native widget
In the Functional settings of a native widget, pick a block at Content block per product. The widget shows the block with the selected product, filled with the product variables. Scripts and tags that need the customer page (such as {ext}) do not work in the widget; the HTML is cleaned for security.
JavaScript in a block? See Can I add code to a content block?


