Access a template variable from another template (or theme hook) I have two templates (and two corresponding preprocess hooks), one rendering a Paragraph, one rendering items from this paragraph.

How to access a variable available in the parent paragraph template (or preprocess Hook) from the items rendering template (or item preprocess hook) ? 

paragraph--paragraph-row.html.twig

{{ content.MyVARIABLE }}  //it works


field--paragraph--paragraph-row2.html.twig

&lt;div class="row"&gt;
  {% for item in items %}
     &lt;div class="col-sm-{{ 12 // parent.MyVARIABLE  }}"&gt;
         {{ item }}
    &lt;/div&gt;
{% endfor %}
&lt;/div&gt;


THANKS !

David
You can't access easily variables from other templates. But you can use the entity objects to access field values.

For a nested paragraph you find the parent paragraph in element['#object']:

field--paragraph.html.twig

{{ element['#object'].field_my_field.value }}