OperaTwigBlockBundle

This bundle OperaTwigBlockBundle will help you to easily add twig code in your blocks

Installation

composer require opera-project/twig-block-bundle

Usage

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


<div class="container">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="text-center">{{ block.name }} - {{ _opera_page.title }}</h1>
        </div>
    </div>
</div>