<p>There are a few ways to deal with this, but it really depends on how you have the rest of your sections set up. If the structure is exclusively products with only a single root level item called "products" then I would probably suggest storing content for the products overview page somewhere else. This will greatly simplify your products structure (you could even change it to a 'channel' if there is no other reason for the hierarchy). Where you decide to store the product index/overview info is up to you. You could, for example:</p>

<ul>
<li>create a single called "products" (with uri '/products'), or </li>
<li>add it to the "pages" structure as "products" (with a custom Entry Type "products"), or </li>
<li>create a template "products/_index.html" with description fields, etc. stored in a global set called "productsDescription" (or whatever you like).</li>
</ul>

<p>Whichever way you choose the product index page will still be "/products/" and the product detail pages will still be "/products/product-slug/".</p>

<p>If you do decide to place the products overview in the "pages" section, for example, you can just check for the entry type using a conditional or <code>switch</code> statement (within the 'page/_entry.html' template), like so:</p>

<pre><code>{% if entry.type == "products" %}
    {# display products index page template here #}
{% endif %}
</code></pre>

<p>However you decide to do it, you can load the actual products like so (as Marion suggested above):</p>

<pre><code>{% for product in craft.entries.section('product') %}
    {{ product.title }}
    ...
{% endfor %}
</code></pre>

CC BY-SA 3.0
2015-01-20T08:25:15.623Z
As per his description, he already has the products in a channel section "product" and wants the index to be an entry of his "page" structure section. But that's what you suggested in the lower part of your answer anyways :)
carlcs
CC BY-SA 3.0
2015-01-20T11:13:38.387Z
Thanks Douglas. Just wanted to make sure that using a single template for all of my pages didn't have overhead  with a conditional to display products for those pages that wouldn't show the products.
doubleplusgood
CC BY-SA 3.0
2015-01-20T15:15:11.043Z
@doubleplusgood don't worry about performance with Twig code like conditionals and includes. Did you read this Doc article: ["How can I give each Entry Type its own template"](http://buildwithcraft.com/help/entry-type-templates)?
carlcs
CC BY-SA 3.0
2015-01-20T16:51:24.187Z
@doubleplusgood I agree with carlcs. The overhead is insignificant. I would design the system in whatever makes most sense from a organizational, development and user perspective.
Douglas McDonald
CC BY-SA 3.0
2015-01-20T00:59:15.700Z
2015-01-20T08:25:26.643Z
2015-01-20T08:25:26.643Z
Douglas McDonald
<p>If your channel is <code>products</code>, you list them like this on their index page (which is presumably your '/products' page)</p>

<pre><code>{% for p in craft.entries.section('products') %}
  {# p is our product. display it however #}
  {{p.title}}
{% endfor %}
</code></pre>

CC BY-SA 3.0
2015-01-19T21:24:53.390Z
Thanks Marion. I guess what I would also like is to pull in the structure page content for 'Products' into the same template but my Page section/channel uses the page/_entry.html template rather than products/index.html
doubleplusgood
CC BY-SA 3.0
2015-01-19T21:22:17.940Z
2015-01-19T21:22:17.940Z
Marion Newlevant
<p>I have created a Structure page 'Products' with a URL of '/products' so that I can write a description etc, but then I would also like to pull in the Products into the template. I'm a little unsure on how best to achieve this.</p>

<p>The Sections are created as follows;</p>

<p>Page<br>
Handle: page<br>
Type: Structure<br>
URL Format: {slug}<br>
Entry Template: page/_entry</p>

<p>Product<br>
Handle: product<br>
Type: Channel<br>
URL Format: products/{slug}<br>
Entry Template: products/_product</p>

<p>In ExpressionEngine I would have pulled in a Channel entries tag for the page and then another entries tag for the products.</p>

<entries><structure>
Create a Structure page with entries list
# Create a Structure page with entries list

(Asked by: username_0 on 2015-01-19)

I have created a Structure page 'Products' with a URL of '/products' so that I can write a description etc, but then I would also like to pull in the Products into the template. I'm a little unsure on how best to achieve this.

The Sections are created as follows;

Page  
Handle: page  
Type: Structure  
URL Format: {slug}  
Entry Template: page/\_entry

Product  
Handle: product  
Type: Channel  
URL Format: products/{slug}  
Entry Template: products/\_product

In ExpressionEngine I would have pulled in a Channel entries tag for the page and then another entries tag for the products.

**Tags:** entries, structure

---

## 2 answers

### Answer by username_1 on 2015-01-20. Score: 1 | Accepted answer

There are a few ways to deal with this, but it really depends on how you have the rest of your sections set up. If the structure is exclusively products with only a single root level item called "products" then I would probably suggest storing content for the products overview page somewhere else. This will greatly simplify your products structure (you could even change it to a 'channel' if there is no other reason for the hierarchy). Where you decide to store the product index/overview info is up to you. You could, for example:

create a single called "products" (with uri '/products'), or 
add it to the "pages" structure as "products" (with a custom Entry Type "products"), or 
create a template "products/_index.html" with description fields, etc. stored in a global set called "productsDescription" (or whatever you like).

Whichever way you choose the product index page will still be "/products/" and the product detail pages will still be "/products/product-slug/".
If you do decide to place the products overview in the "pages" section, for example, you can just check for the entry type using a conditional or switch statement (within the 'page/_entry.html' template), like so:
{% if entry.type == "products" %}
    {# display products index page template here #}
{% endif %}

However you decide to do it, you can load the actual products like so (as Marion suggested above):
{% for product in craft.entries.section('product') %}
    {{ product.title }}
    ...
{% endfor %}

> **Comments:**
> **username_2**: As per his description, he already has the products in a channel section "product" and wants the index to be an entry of his "page" structure section. But that's what you suggested in the lower part of your answer anyways :)  
> **username_0**: Thanks Douglas. Just wanted to make sure that using a single template for all of my pages didn't have overhead  with a conditional to display products for those pages that wouldn't show the products.  
> **username_2**: @doubleplusgood don't worry about performance with Twig code like conditionals and includes. Did you read this Doc article: ["How can I give each Entry Type its own template"](http://buildwithcraft.com/help/entry-type-templates)?  
> **username_1**: @doubleplusgood I agree with carlcs. The overhead is insignificant. I would design the system in whatever makes most sense from a organizational, development and user perspective.  

---

### Answer by username_3 on 2015-01-19. Score: 1

If your channel is products, you list them like this on their index page (which is presumably your '/products' page)
{% for p in craft.entries.section('products') %}
  {# p is our product. display it however #}
  {{p.title}}
{% endfor %}

> **Comments:**
> **username_0**: Thanks Marion. I guess what I would also like is to pull in the structure page content for 'Products' into the same template but my Page section/channel uses the page/_entry.html template rather than products/index.html  

---

