I recently upgraded a site from Craft 2 to Craft 3, so I'm trying to figure out what was deprecated and caused this error.
At the top of the page I have this
{% set solutions = craft.entries.section('solutions').level(1).all() %}
And I'm trying to invoke a dropdown menu like so
<li class="nav-item {% if craft.request.segment(1) == 'solutions' %}active{% endif %}">
{% nav solution in solutions.limit(1) %}
<a class="nav-link" href="{{ solution.url }}">solutions<span class="sr-only">(current)</span> <i class="icon-downarrow"></i> </a>
{% endnav %}
<ul class="submenu">
{% nav solution in solutions %}
<li>
<a href="{{ solution.url }}">{{ solution.title }}</a>
</li>
{% endnav %}
</ul>
</li>
Before I didn't have .all()
at the end, but only the first menuitem was showing up.
When I added .all()
in, I get the error "Impossible to invoke a method ("limit") on an array."