0

I need to populate breadcrumb navigation with the data I defined inside set breadcrumb. So, my code looks like this:

Breadcrumb items:

{% set breadcrumb = [{ name : 'Item name 1'}, { name : 'Item name 2'}, { name : 'Item name 3'}] %}

And the loop looks like this:

<nav>
    <ul>
        {% for item in breadcrumb %}
        <li>
            <span>{{name}}</span>
        </li>
        {% endfor %}
    </ul>
</nav>

But, the output is half-working. I get the <li> elements, but no Name. Just empty <span>.

<nav>
    <ul>
        <li>
            <span></span>
        </li>
        <li>
            <span></span>
        </li>
        <li>
            <span></span>
        </li>
    </ul>
</nav>

Something with {{name}} is not ok, but I don't understand what.

momciloo
  • 887
  • 1
  • 11
  • 24

1 Answers1

0

I managed it to solve the problem. The problem was, as I previously mentioned, in {{name}} part, witch, in provided example should be {{item.name}}

momciloo
  • 887
  • 1
  • 11
  • 24