How to loop partials in Assemble

104 views Asked by At

I am trying to loop an array of partials in my styleguide but all I get is the partial name and not the actual partial.

Here is my data:

{"omnijoin-components": [
    {
        "id": "accordion",
        "component": "omnijoin-accordion"
    },
    {
        "id": "banner",
        "component": "omnijoin-banner"
    },
    {
        "id": "benefits",
        "component": "omnijoin-benefits"
    }]}

Here is my assemble code:

{{#each omnijoin-components}}
<div class="bs-docs-section" data-component-section>

    <h1 id="#{{this.id}}" class="page-header">Accordion</h1>

    <div class="bs-example" data-code-example>
        {{> this.component}}
    </div>

    <a class="showcode-marker" data-show-code>Show Code</a>

<pre>
<code class="language-markup" data-code-snippet>

</code>
</pre>
</div>   
{{/each}}

This will error because it is trying to find this.component and not the actual partial name.

Is this possible with assemble or not?

Thank you

0

There are 0 answers