I am trying to figure out how I can put categories to use, and I need some help.
I have created a category group called "group1", and 2 catogories inside called "cat1" and "cat2". and I have added the catogorie field to some articles in a structure so that I have a few linked to both cat1 and cat2.
My goal simply to make a forloop listing the catogorie title of both cat1 and cat2, and create an UL with the entry.title of the entries in each catogorie.
This is my code:
{% for cat in craft.categories.group('group1') %}
<p>{{ cat.title }}</p>
{% for entry in craft.entries.section('structure').level(3).relatedTo(cat) %}
<ul>
<li>{{ entry.title }}</li>
</ul>
{% endfor %}
{% endfor %}
This gives me the two catogorie titles, but no entry titles. I dont think I understand how to use the related to group part. Would really appreaciate some help figuring this one out.