Templating
linotype/Block
The template of a block allows you to code a piece of your site. Lots of variables and functions are available to make your template powerful.
TWIG
PHP
JSX
<div id="{{block.id}}" uid="{{block.uid}}" class="{{block.class}}">
<h1>Hello world !</h1>
{{childrens}}
<div>
TODO
TODO with v8js ssr
variable | description |
{{block.id}} | Unique block ID: #block--block_key |
{{block.uid}} | Unique block ID: #md5(themeKey__templateKey__blockKey) |
{{block.class}} | Class id .block--block_id |
{{block.childrens}} | Array of childrens defined in module or template config |
{{childrens}} | Rendered childrens define in module or template config |
Use your context key just like variables. Their values change depending on the configuration and where the block is used.
TWIG
PHP
JSX
{% if context_id_1 and context_id_2 %}
<div id="{{block.id}}" uid="{{block.uid}}" class="{{block.class}}">
{{context_id_1}}
{{context_id_2}}
<div>
{% endif %}
TODO
TODO with v8js ssr
TWIG
PHP
JSX
{% set title = linotype.helper.format.removeTags( text ) %}
<div id="{{block.id}}" uid="{{block.uid}}" class="{{block.class}}">
<h1>{{title}}</h1>
<div>
TODO
TODO with v8js ssr
Last modified 1yr ago