Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delineas/175580e1bdc1a82a260898e46670af54 to your computer and use it in GitHub Desktop.
Save delineas/175580e1bdc1a82a260898e46670af54 to your computer and use it in GitHub Desktop.
Twig coding standards
https://www.drupal.org/node/1823416
Filters - Modifying Variables In Twig Templates
https://www.drupal.org/node/2357633
{% for i, value in content.field_app_prod_toggle_products %}
{% if node.field_app_prod_toggle_products[i].entity %}
{% if i == 0 %}
<div class="tabs-panel is-active" id="panel-0">
{% else %}
<div class="tabs-panel" id="panel-{{ i }}">
{% endif %}
<h2>{{ node.field_app_prod_toggle_products[i].entity.field_product_subhead.value }}</h2>
{{ node.field_app_prod_toggle_products[i].entity.body.value|t }}
<h3>{{ node.field_app_prod_toggle_products[i].entity.field_product_highlight_title.value }}</h3>
{{ node.field_app_prod_toggle_products[i].entity.field_product_highlight.value|t }}
<p class="explore-product-btn">
<a class="button" href="{{ path('entity.node.canonical', {'node': node.field_app_prod_toggle_products[i].entity.id}) }}">Explore <i class="fa fa-arrow-right" aria-hidden="true"></i></a>
</p>
</div>
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment