I've looked at several answers on here regarding this one and as far as I can make out this should bring out all entries related to a specific category slug. However it just seems to be returning all entries regardless of whether it's related or not? What am I missing? Also in case it makes a difference there is one category level but an entry can have multiple categories selected.

{% set category = craft.categories.group('markets').slug('marine').first() %}
{% set products = craft.entries.section('products').realtedTo(category).limit(null) %}
{% for product in products %}
    {{ product.title }}
{% endfor %}

There's a typo in your code :) You misspelled relatedTo. I'm assuming that's the issue because other that than, the code looks like it should work.

  • What a donut! Good spot @user5400 which proves it's always good to walk away from it when it's not happening and take a fresh look later on. Cheers
    – Lettie
    Aug 18 '16 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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