Ad

Take Variable From Component

- 1 answer

i want take variables from component. This is my code:

<!-- Gallery -->
<div class="galeryWraper">
<div class="row" >
   <h3>{{ galeria1.post.title }} {{ galeria1.post.description }}</h3>
        <div class="col-sm-8">

            {% component 'galeria1' %}

        </div>
      </div>
 </div>

 <!-- End Gallery -->

Galery works fine. But galery title and desciption doesnt show up.

Does somebody know why?

Ad

Answer

To access the property from the Twig partials for the component, utilize the __SELF__ variable which refers to the Component object:

{{ __SELF__.property('title') }}

Ad
source: stackoverflow.com
Ad