It's a pretty basic question, but for some reason all of the possible solutions do not work for me.
I tried this: https://craftcms.com/docs/relations#the-relatedTo-param And also this (which I really expected to solve my problem): https://craftcms.com/support/entries-related-to-category
I'm pretty sure I may have overlooked something, but I can't see what.
I made this:
{% set lastSeg = craft.request.lastSegment %}
{% set meubels = craft.entries.section('meubels').relatedTo(lastSeg) %}
And use this as a test:
{% for meub in meubels %}
test<br>
{{ meub.title }}<br>
{% endfor %}
According to every answer to related questions this should work, but unfortunately it returns nothing. But lastSegment
does return the required string from the URL. (At least, I'm assuming this must be a string)
I made a list of categories which all seem to route just fine, no problems there.
category
in your template.category
is the category model for whatever category you were routed to, so you might be able to skip the first step in my answer!