Display category entries based on Segment? 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()  %}
        &lt;h3&gt;{{ entry.title }}&lt;/h3&gt;
    {% 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
How do I list the entries related to a category? article on the Craft site should get you headed in the right direction.


  You can fetch the entries related to a given category with a little
  help from craft.entries and the relatedTo param.


{# Fetch all of the entries related to this category #}
{% set entries = craft.entries.relatedTo(category) %}

{# Output them #}
{% for entry in entries %}
    &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
{% endfor %}