Answers.Body: <p>It sounds like you're pretty close. I'll work off of the assumption that you want the URLs to be structured like this:</p>
  
  <p>/images</p>
  
  <p>/lifestyle</p>
  
  <p>/food</p>
  
  <p>…and an individual image will be at /images/{image slug}.</p>
  
  <p>Like you've done, I'd create a category group called <strong>photoGalleries</strong>. I'd set the URL format simple to <code>/{slug}</code> and a max level of 1. The two categories can then be added to that.</p>
  
  <p>The <strong>images</strong> channel would have a URL format of <code>/images/{slug}</code>.</p>
  
  <p>By setting up categories and the channel like this, Craft will automatically create variables when it matches those paths. You can then use these variables to do practical things.</p>
  
  <p>To show images by category, you'll need to use to <a href="http://buildwithcraft.com/docs/relations#the-relatedTo-param" rel="nofollow"><code>.relatedTo()</code></a> method. When Craft matches a category route, it will create a <code>category</code> <a href="http://buildwithcraft.com/docs/templating/categorymodel" rel="nofollow">variable</a> which can be passed into this method. In the template for a category, you'll need code like this:</p>
  
  <pre><code>{% set images = craft.entries.section('images').relatedTo(category).find() %}
  {% for image in images %}
      &lt;img src="{{ image.url }}"&gt;
  {% endfor %}
  </code></pre>
  
  <p>This asks Craft to find any image which has been categorised by (related to) a specific category.</p>
  
  <p>You can then create a simple images listing via a template for <code>/images</code>. If you wanted to get really fancy, you could output what categories an image is under. To do that you'd need code like this.</p>
  
  <pre><code>{% for image in craft.entries.images.find() %}
      &lt;img src="{{ image.url }}"&gt;
  
      &lt;ul&gt;
      {% for category in craft.categories.relatedTo(image).find() %}
          &lt;li&gt;&lt;a href="{{ category.url }}"&gt;{{ category }}&lt;/a&gt;&lt;/li&gt;
      {% endfor %}
      &lt;/ul&gt;
  {% endfor %}
  </code></pre>
  
  <p>Hope that gets you going.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-04T15:33:15.167Z
Answers.LastActivityDate: 2014-08-04T15:33:15.167Z
Answers.UserDisplayName: Stuart Whitehead
Answers.Body: <p>Apologies for the "Answer" but the comments have a way too short character restriction...</p>
  
  <p>I've been away for a few days so only just getting back to this.  I'm still not getting any content pulled through following your suggestion.  I've even gone back to a clean slate (install) but still struggling.</p>
  
  <p>Just to clarify:
  I (now) have a Category group called "<em>stmimagecategories</em>".
  I have assigned an Asset field to this group called "<em>imageUpload</em>".
  I have created a Category field called "<em>imageCategory</em>".</p>
  
  <p>My '<strong>Section</strong>' is called '<strong>Gallery</strong>' and I have assigned the '<em>imageCategory</em>' field to that section.</p>
  
  <p>I imagine the clients workflow would be to use the '<strong>Categories</strong>' menu and subsequent Modal to dump a load of images into the appropriate category using the '<em>imageUpload</em>' field.</p>
  
  <p>So, what I need is... User creates a new Gallery <strong>entry</strong> called say "Panoramas".  They add a title, bit of descriptive text and then select 'Panoramas' from the '<em>imageCategory</em>' field.</p>
  
  <p>I have the above set-up but the required template syntax to pull the content of the "<em>imageCategory</em>" field is blowing my mind :(</p>
  
  <p>Further, the 'page needs to know what to show based on URL.</p>
  
  <p>If you can help further with this I would be very much appreciate it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-11T18:13:56.407Z
Answers.LastActivityDate: 2014-08-11T18:13:56.407Z
Answers.UserDisplayName: Martin
Body: <p>I have a photography website with just two categories, 'Lifestyle' and 'Food'.</p>
  
  <p>I have two problems:</p>
  
  <ol>
  <li>How to display the content</li>
  </ol>
  
  <p>I have a category group called 'photoCategories' to which I have assigned two categories 'Lifestyle' and 'Food'.  I also have a Category field 'imageCategory'.</p>
  
  <p>At the moment I have two Entries, one for Lifestyle and one for Food and I have linked to the appropriate category in the category field.</p>
  
  <p>I have a 'category' template but I can't figure how to pull the appropriate content based on the URI and how to pull All content (within) the category group for when the user selects All?</p>
  
  <ol>
  <li>My navigation needs to look as follows:</li>
  </ol>
  
  <p>Homepage (Single)
  All Images ('images' Channel)
  Lifestyle Photos ('images' Channel)
  Food Photos ('images' Channel)
  About Us (Single)
  Contact Us (Single)</p>
  
  <p>Any advice is very much appreciated.</p>
  
  <p>Thanks</p>
  
  <p>Martin</p>
  
Tags: <templating><categories><navigation>
Title: Showing specific category content as well as ALL
ThreadText: # Showing specific category content as well as ALL
  
  (Asked by: username_0 on 2014-08-04)
  
  I have a photography website with just two categories, 'Lifestyle' and 'Food'.
  
  I have two problems:
  
  1. How to display the content
  
  I have a category group called 'photoCategories' to which I have assigned two categories 'Lifestyle' and 'Food'. I also have a Category field 'imageCategory'.
  
  At the moment I have two Entries, one for Lifestyle and one for Food and I have linked to the appropriate category in the category field.
  
  I have a 'category' template but I can't figure how to pull the appropriate content based on the URI and how to pull All content (within) the category group for when the user selects All?
  
  1. My navigation needs to look as follows:
  
  Homepage (Single)
  All Images ('images' Channel)
  Lifestyle Photos ('images' Channel)
  Food Photos ('images' Channel)
  About Us (Single)
  Contact Us (Single)
  
  Any advice is very much appreciated.
  
  Thanks
  
  username_0
  
  **Tags:** templating, categories, navigation
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2014-08-04. Score: 3
  
  It sounds like you're pretty close. I'll work off of the assumption that you want the URLs to be structured like this:
  
  /images
  
  /lifestyle
  
  /food
  
  …and an individual image will be at /images/{image slug}.
  
  Like you've done, I'd create a category group called **photoGalleries**. I'd set the URL format simple to `/{slug}` and a max level of 1. The two categories can then be added to that.
  
  The **images** channel would have a URL format of `/images/{slug}`.
  
  By setting up categories and the channel like this, Craft will automatically create variables when it matches those paths. You can then use these variables to do practical things.
  
  To show images by category, you'll need to use to [`.relatedTo()`](http://buildwithcraft.com/docs/relations#the-relatedTo-param) method. When Craft matches a category route, it will create a `category` [variable](http://buildwithcraft.com/docs/templating/categorymodel) which can be passed into this method. In the template for a category, you'll need code like this:
  
  ```
  {% set images = craft.entries.section('images').relatedTo(category).find() %}
  {% for image in images %}
      <img src="{{ image.url }}">
  {% endfor %}
  
  ```
  
  This asks Craft to find any image which has been categorised by (related to) a specific category.
  
  You can then create a simple images listing via a template for `/images`. If you wanted to get really fancy, you could output what categories an image is under. To do that you'd need code like this.
  
  ```
  {% for image in craft.entries.images.find() %}
      <img src="{{ image.url }}">
  
      <ul>
      {% for category in craft.categories.relatedTo(image).find() %}
          <li><a href="{{ category.url }}">{{ category }}</a></li>
      {% endfor %}
      </ul>
  {% endfor %}
  
  ```
  
  Hope that gets you going.
  
  
  ---
  
  ### Answer by username_0 on 2014-08-11. Score: 0
  
  Apologies for the "Answer" but the comments have a way too short character restriction...
  
  I've been away for a few days so only just getting back to this. I'm still not getting any content pulled through following your suggestion. I've even gone back to a clean slate (install) but still struggling.
  
  Just to clarify:
  I (now) have a Category group called "*stmimagecategories*".
  I have assigned an Asset field to this group called "*imageUpload*".
  I have created a Category field called "*imageCategory*".
  
  My '**Section**' is called '**Gallery**' and I have assigned the '*imageCategory*' field to that section.
  
  I imagine the clients workflow would be to use the '**Categories**' menu and subsequent Modal to dump a load of images into the appropriate category using the '*imageUpload*' field.
  
  So, what I need is... User creates a new Gallery **entry** called say "Panoramas". They add a title, bit of descriptive text and then select 'Panoramas' from the '*imageCategory*' field.
  
  I have the above set-up but the required template syntax to pull the content of the "*imageCategory*" field is blowing my mind :(
  
  Further, the 'page needs to know what to show based on URL.
  
  If you can help further with this I would be very much appreciate it.
  
  
  ---
  
  