My URL: http://localhost/product-family/compressors

How can I list the related products? I don't understand how to get access to the compressors (a category entry of the product-family category type). The product-family is a structure - so there may be many levels.

(I thought I'd have access to the currently selected category via entry but I get error when I try to access it.)

1 Answer 1


The same way as entry is available if you hit an entry, the variable category is available if you hit a category.

Thus the following code:

{% if category is defined %}
    {# Specific category selected #}             
{% else %}
    {# No specific category selected #}
{% endif %}

Your Answer

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

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