I'm really struggling to display entries of a category, based on the segment. In other words, I have 1 category template, so the category needs to be determined dynamically (*we still do this by segment, right?? or is that not the best practice?)
I was trying something like this, but I can't seem to get it right:
{% for category in craft.categories.group('typeOfPack').find() %}
{% set active = (
craft.request.Segment(2) == category.slug
) %}
{% for entry in entry.typeOfPack.search('active').find() %}
<h3>{{ entry.title }}</h3>
{% endfor %}
{% endfor %}
Apologies if this offensively bad. As I try to get my head around Twig, I'm wondering if there are some high level errors, for instance: 1. Does the {% for entry... %} need to be inside the {%for category... %}? Do I even need to do the {% for category...%} stuff if I'm just needing entries, or is the ".search(...)" sufficient?
Thank you so much.
Big Mike