Related category on a single page Been trying for days to figure this one out. How do I extract entries from a channel and display only entries related to a category? How do I pull in the related photo? I have this code below but it pulls in all the photos. I don't think I'm doing doing this right.

{% set category = craft.categories.slug('spring-summer').first() %}

{% for post in craft.entries.section('product').relatedTo({targetElement: category}) %}

    &lt;h2&gt;{{ post.title }}&lt;/h2&gt;
    &lt;p&gt;{{ post.price }}&lt;/p&gt;

    {% for product in craft.entries.find() %}
        {% for image in product.photo %}
            &lt;img src="{{ image.getUrl('bottom') }}" /&gt;
        {% endfor %}
    {% endfor %}
{% endfor %}
When you set up your category, you check the Categories in this group have their own URLs box, and you give the category a URL (suppose it is category/{slug}), and a template (suppose it is category/_entry). Now in the category/_entry.html template, category will be defined (the way entry is defined on the template for a section entry).

How do I list the entries related to a category? (tucked away in the Get Help section of the Craft website) describes how to fetch and list the entries related to a category:

{# 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 %}


If you want to narrow the entries down to a single section, then fetch them like this:

{% set entries = craft.entries.section('mySectionHandle').relatedTo(category) %}