Forked from frankyonnetti/Drupal8--loop-entity-reference-fields.php.twig
Created
July 16, 2018 17:08
-
-
Save delineas/175580e1bdc1a82a260898e46670af54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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