layout | title | body_class |
---|---|---|
doc |
OperaTwigBlockBundle |
body-pink |
This bundle OperaTwigBlockBundle{:target="_blank"} will help you to easily add twig code in your blocks
composer require opera-project/twig-block-bundle
You can already add some js, static content like ads, or image using a OperaTextBlockBundle... Well, with the OperaTwigBlockBundle you can also add twig code.
Instead of some static code like
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="text-center">Hello This is my static title</h1>
<a href='/my_link'>
</div>
</div>
</div>
You can use the twig variables available on the current page context
{% raw %}
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="text-center">{{ block.name }} - {{ _opera_page.title }}</h1>
</div>
</div>
</div>
{% endraw %}