Answers.Body: <p>Two ways that this can be done is A) use a structure, or B) use <a href="http://buildwithcraft.com/docs/routing#dynamic-routes" rel="nofollow noreferrer">custom routes</a>. </p>
  
  <p>Using a <code>Structure</code> with different <code>entry types</code> defined for the various sub-page types would probably be the most straightforward and flexible. The base of the structure would be projects (but could just as easily start above projects, if you also wanted to use it to <a href="http://buildwithcraft.com/help/structure-nav" rel="nofollow noreferrer">generate your site nav</a>). Your structure might look something like this:</p>
  
  <pre><code>/project1 (entry type: project)
     /news (entry type: projectNews)
     /gallery (entry type: projectGallery)
  /project 2
     /...
  </code></pre>
  
  <p>In your <code>projectNews</code> template, you can access the 'project' entry through <code>entry.parent</code> and can retrieve the news related to the project using <code>relatedTo()</code>:</p>
  
  <pre><code>{% set project = entry.parent %}
  {% set projectNews = craft.entries.section('news').relatedTo(project) %}
  {% for entry in projectNews %}
      &lt;article&gt;
          {{ entry.title }}
          ...
      &lt;/article&gt;
  {% endfor %}
  </code></pre>
  
  <p>The advantage of the structure is that: you can selectively add these pages to projects on a case by case basis; you can add additional content to the news or gallery pages as needed, in addition to the related content; and that it automatically generates the uri that your looking for.</p>
  
  <p>The other option would be to create <a href="http://buildwithcraft.com/help/structure-nav" rel="nofollow noreferrer">custom routes</a>, using the project slug as one of the uri segments (i.e. <code>projects/{slug}/news</code>). The variable <code>slug</code> will be accessible in the templates and can be used to fetch the project using an <code>Element Criteria Model</code>, and the related content via <code>relatedTo()</code>:</p>
  
  <pre><code>{% set project = craft.entries.section('projects').slug(slug) %}
  {% set projectNews = craft.entries.section('news').relatedTo(entry) %}
  {% for entry in projectNews %}
      &lt;article&gt;
          {{ entry.title }}
          ...
      &lt;/article&gt;
  {% endfor %}
  </code></pre>
  
  <p>The advantage here is that you don't need to generate those additional entries, if 'news' and 'gallery' will always be defined. And if you did need some customizable content for those pages, you could easily place that in the projects main entry.</p>
  
  <p>For another example see this question regarding <a href="https://craftcms.stackexchange.com/questions/4383/help-with-understanding-how-to-structurally-build-a-sermon-catalogue/4385#4385">site structure</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-13T08:16:32.663Z
Answers.Text: Thank you for your answer. I'll check out these two options, at this point I'm tempted towards using option B.
Answers.UserDisplayName: Martijn B.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-23T03:51:27.313Z
Answers.Text: It is worth noting that custom route templates can throw 404 errors for content where the route is inappropriate using `{% exit 404 %}`. So whilst the route always exists, if it isn't valid for certain content, then it can behave properly when somebody modifies the address bar in the browser.
Answers.UserDisplayName: Lea Hayes
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-11-12T14:20:18.457Z
Answers.LastActivityDate: 2014-11-12T16:01:01.453Z
Answers.LastEditDate: 2017-04-13T12:51:00.303Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>For a project I'm working on I have set up several channels that are related to each other. What the setup comes down to is the following:</p>
  
  <p>Channels:</p>
  
  <pre><code>Projects
  |- News relations (news is a channel and news entries can be related to a project entry)
  |- Gallery relations (gallery is a channel and galleries can be related to a project entry)
  |- ... and more related content ...
  </code></pre>
  
  <p>Now I can visit the projects overview on the <code>/projects</code> path and a project entry on the <code>/projects/{slug}</code> path. The project entry page shows a short overview of the related content (i.e. 2 or 3 of the related items for the various channels), but will also contain a link to the full listing of all news items/galleries/etc of the requested projected.</p>
  
  <p>Preferably I would have a url for these subpages to the project on a path like <code>/projects/{slug}/news</code> and <code>/projects/{slug}/gallery</code>.</p>
  
  <p>How would I set this up? I've been looking around, but can't find any solution to this.</p>
  
Tags: <structure><relations><entry><content>
Title: Creating a related content subpage to a channel entry?
ThreadText: # Creating a related content subpage to a channel entry?
  
  (Asked by: username_0 on 2014-11-12)
  
  For a project I'm working on I have set up several channels that are related to each other. What the setup comes down to is the following:
  
  Channels:
  
  ```
  Projects
  |- News relations (news is a channel and news entries can be related to a project entry)
  |- Gallery relations (gallery is a channel and galleries can be related to a project entry)
  |- ... and more related content ...
  
  ```
  
  Now I can visit the projects overview on the `/projects` path and a project entry on the `/projects/{slug}` path. The project entry page shows a short overview of the related content (i.e. 2 or 3 of the related items for the various channels), but will also contain a link to the full listing of all news items/galleries/etc of the requested projected.
  
  Preferably I would have a url for these subpages to the project on a path like `/projects/{slug}/news` and `/projects/{slug}/gallery`.
  
  How would I set this up? I've been looking around, but can't find any solution to this.
  
  **Tags:** structure, relations, entry, content
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-11-12. Score: 4 | Accepted answer
  
  Two ways that this can be done is A) use a structure, or B) use [custom routes](http://buildwithcraft.com/docs/routing#dynamic-routes).
  
  Using a `Structure` with different `entry types` defined for the various sub-page types would probably be the most straightforward and flexible. The base of the structure would be projects (but could just as easily start above projects, if you also wanted to use it to [generate your site nav](http://buildwithcraft.com/help/structure-nav)). Your structure might look something like this:
  
  ```
  /project1 (entry type: project)
     /news (entry type: projectNews)
     /gallery (entry type: projectGallery)
  /project 2
     /...
  
  ```
  
  In your `projectNews` template, you can access the 'project' entry through `entry.parent` and can retrieve the news related to the project using `relatedTo()`:
  
  ```
  {% set project = entry.parent %}
  {% set projectNews = craft.entries.section('news').relatedTo(project) %}
  {% for entry in projectNews %}
      <article>
          {{ entry.title }}
          ...
      </article>
  {% endfor %}
  
  ```
  
  The advantage of the structure is that: you can selectively add these pages to projects on a case by case basis; you can add additional content to the news or gallery pages as needed, in addition to the related content; and that it automatically generates the uri that your looking for.
  
  The other option would be to create [custom routes](http://buildwithcraft.com/help/structure-nav), using the project slug as one of the uri segments (i.e. `projects/{slug}/news`). The variable `slug` will be accessible in the templates and can be used to fetch the project using an `Element Criteria Model`, and the related content via `relatedTo()`:
  
  ```
  {% set project = craft.entries.section('projects').slug(slug) %}
  {% set projectNews = craft.entries.section('news').relatedTo(entry) %}
  {% for entry in projectNews %}
      <article>
          {{ entry.title }}
          ...
      </article>
  {% endfor %}
  
  ```
  
  The advantage here is that you don't need to generate those additional entries, if 'news' and 'gallery' will always be defined. And if you did need some customizable content for those pages, you could easily place that in the projects main entry.
  
  For another example see this question regarding [site structure](https://craftcms.stackexchange.com/questions/4383/help-with-understanding-how-to-structurally-build-a-sermon-catalogue/4385#4385).
  
  > **Comments:**
  > **username_0**: Thank you for your answer. I'll check out these two options, at this point I'm tempted towards using option B.  
  > **username_2**: It is worth noting that custom route templates can throw 404 errors for content where the route is inappropriate using `{% exit 404 %}`. So whilst the route always exists, if it isn't valid for certain content, then it can behave properly when somebody modifies the address bar in the browser.  
  
  ---
  
  