wickywills
3/23/2017 - 12:25 PM

Loop includes

Loop includes

To create a loop of includes, for example a news article component as part of a list:

{% for article in articles %}
    <div class="vert-push--small">
        {% include 'components/news/article' with article %}
    </div>
{% endfor %}
"articles" : [
        {
            "heading" : "Article 1",
            "image" : "http://placehold.it/350x235",
            "date" : "Published on 17th November 2016",
            "excerpt" : "All electronics is created today with integral capability for testing the circuits during production…"
        },
        {
            "heading" : "Product Of The Month - PCB Test Points Reducing Costs",
            "image" : "http://placehold.it/350x235",
            "date" : "Published on 17th November 2016",
            "excerpt" : "All electronics is created today with integral capability for testing the circuits during production…"
        }
    ],