Home » PHP » Pimcore » Top Twig Template Interview And Answer Part 1

Top Twig Template Interview And Answer Part 1

1. How can we the path with param variables in twig template?

{{ path('abc',{'test':'1'}) }}

2. How to display a string that contains HTML tags in twig template?

{% set var = '<b> Hello Word </b>' %}
{{ var|raw }}

3. How we can update title dynamically in twig template?

{% set title = 'Rozana Samachar Forum is great platform' %}
{% do pimcore_head_title(title) %}

4. How can we check that any editable have a data or not and in admin mode in twig template?

{% set content= pimcore_wysiwyg('content', {
    height: 100
}) %}

{% if editmode or not content.isEmpty() %}   
        {{ content|raw }}
{% endif %}

5. How we can loop the editables in twig template?

 {% for i in pimcore_iterate_block(pimcore_block('links')) %}
        {{ pimcore_link('link') }}
 {% endfor %}

Check Also

Pimcore

How can disable the Pimcore Bundle?

To disable the pimcore bundle run the below command on the ubuntu terminal in the …

Leave a Reply

Your email address will not be published. Required fields are marked *