3

In a template for a category page, I'm trying to output a list of links through to all categories within a category group but exclude the category that the user is on.

Does that make sense? What I'm trying doesn't work, but I'm new to Craft and Twig!

1 Answer 1

5

With a little help I got there:

{% set categories = craft.categories.group('developmentType').id('not ' ~ category.id) %}
<ul>
{% for category in categories %}
    <li><a href="{{ category.url }}" class="btn">{{ category }} Opportunities</a></li>
{% endfor %}
</ul>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.