Answers.Body: <p>I don't know if its possible to be much clearer than <a href="http://buildwithcraft.com/docs/sections-and-entries#section-types" rel="noreferrer">the official docs</a> on this matter, but basically a Structure is needed if your entries needs to be in <em>a specific order</em> (and you want to manage that order w/ an easy to use, drag-n-drop interface within the Control Panel), or if they need to be <em>nested</em> (i.e. hierarchical, with parent/child entries).</p>
  
  <p>The alternative to a Structure is a Channel. A Channel doesn't have the ability to nest entries – in other words, it's a flat <em>stream</em> of content – nor can entries be sorted in a specific order; you're stuck with sorting by published date, title, ID or other "standard" meta data. The best example of a good use case for a Channel I can think of is a <em>blog</em>.</p>
  
  <p>If you create a Channel and later realize that it should've been a Structure, you can convert it by visiting that Section's settings and choosing "Structure" for its type. You can also convert a Structure to a Channel, although if you later convert it back to a Structure your ordering/nesting data will be lost.</p>
  
  <p><em>Some good use cases for a Structure could be:</em></p>
  
  <ul>
  <li>A "Documentation" type section, with "main" entries (e.g. "Javascript") and sub entries (e.g. "Javascript / jQuery"). <a href="http://buildwithcraft.com/docs/introduction" rel="noreferrer">The official Craft docs</a> are built using a Structure, where child entries (e.g. "Requirements") are nested under parent entries (e.g. "Installing and updating"). See <a href="https://craftcms.stackexchange.com/a/8762/1098">this answer from Brad Bell</a> for a bit more information on how P&amp;T built the docs.</li>
  <li>A "Navigation" type section – some people like to build their site's navigation using a Structure, which makes it easy to edit the order of the nav items, create dropdowns/sub menus etc. <a href="https://craftcms.stackexchange.com/questions/9942/navigation-structure-usage-woes">Here's a thread with some information more information on this approach</a>.</li>
  <li>A "Recipes" section, where you could easily sort the different recipes after course types (meat/vegetarian)</li>
  </ul>
  
  <p><em>As for using Structures</em>, I'm assuming you're talking about how to display the entries in a template – as the usage within the Control Panel should be fairly self-explanatory. Basically, outputting entries from a Structure is no different from the other section types:</p>
  
  <pre><code>{% for entry in craft.entries.section('myStructureSectionHandle') %}
      ...
  {% endfor %}
  </code></pre>
  
  <p>However, if your Structure's entries are nested, using the <a href="http://buildwithcraft.com/docs/templating/nav" rel="noreferrer"><code>nav</code></a> tag instead of the basic <code>for</code> loop can be helpful in displaying the hierarchical content, because it can recursively output child entries:</p>
  
  <pre><code>{% nav entry in craft.entries.section('myStructureSectionHandle') %}
      &lt;li&gt;
          &lt;a href="{{ entry.url }}"&gt;{{ entry.title }}&lt;/a&gt;
          {% ifchildren %}
              &lt;ul&gt;
                  {% children %}
              &lt;/ul&gt;
          {% endifchildren %}
      &lt;/li&gt;
  {% endnav %}
  </code></pre>
  
  <p>Beyond this, I think your question is a bit too open-ended to answer in detail, and you should probably create separate questions for any specific issues or problems you encounter working with Structures.    </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-19T10:30:44.627Z
Answers.LastActivityDate: 2015-06-19T10:57:29.997Z
Answers.LastEditDate: 2017-04-13T12:51:00.303Z
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Body: <p>I read the documentation but I'm still confused about the Structure sections..</p>
  
  <p>What they are usually used for? What are the advantages of using it?
  And most important how to use them?</p>
  
  <p>Please can you explain with some examples?</p>
  
Tags: <structure><sections>
Title: How does the Structure section type work?
ThreadText: # How does the Structure section type work?
  
  (Asked by: username_0 on 2015-06-19)
  
  I read the documentation but I'm still confused about the Structure sections..
  
  What they are usually used for? What are the advantages of using it?
  And most important how to use them?
  
  Please can you explain with some examples?
  
  **Tags:** structure, sections
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-06-19. Score: 13
  
  I don't know if its possible to be much clearer than [the official docs](http://buildwithcraft.com/docs/sections-and-entries#section-types) on this matter, but basically a Structure is needed if your entries needs to be in *a specific order* (and you want to manage that order w/ an easy to use, drag-n-drop interface within the Control Panel), or if they need to be *nested* (i.e. hierarchical, with parent/child entries).
  
  The alternative to a Structure is a Channel. A Channel doesn't have the ability to nest entries – in other words, it's a flat *stream* of content – nor can entries be sorted in a specific order; you're stuck with sorting by published date, title, ID or other "standard" meta data. The best example of a good use case for a Channel I can think of is a *blog*.
  
  If you create a Channel and later realize that it should've been a Structure, you can convert it by visiting that Section's settings and choosing "Structure" for its type. You can also convert a Structure to a Channel, although if you later convert it back to a Structure your ordering/nesting data will be lost.
  
  *Some good use cases for a Structure could be:*
  
  * A "Documentation" type section, with "main" entries (e.g. "Javascript") and sub entries (e.g. "Javascript / jQuery"). [The official Craft docs](http://buildwithcraft.com/docs/introduction) are built using a Structure, where child entries (e.g. "Requirements") are nested under parent entries (e.g. "Installing and updating"). See [this answer from Brad Bell](https://craftcms.stackexchange.com/a/8762/1098) for a bit more information on how P&T built the docs.
  * A "Navigation" type section – some people like to build their site's navigation using a Structure, which makes it easy to edit the order of the nav items, create dropdowns/sub menus etc. [Here's a thread with some information more information on this approach](https://craftcms.stackexchange.com/questions/9942/navigation-structure-usage-woes).
  * A "Recipes" section, where you could easily sort the different recipes after course types (meat/vegetarian)
  
  *As for using Structures*, I'm assuming you're talking about how to display the entries in a template – as the usage within the Control Panel should be fairly self-explanatory. Basically, outputting entries from a Structure is no different from the other section types:
  
  ```
  {% for entry in craft.entries.section('myStructureSectionHandle') %}
      ...
  {% endfor %}
  
  ```
  
  However, if your Structure's entries are nested, using the [`nav`](http://buildwithcraft.com/docs/templating/nav) tag instead of the basic `for` loop can be helpful in displaying the hierarchical content, because it can recursively output child entries:
  
  ```
  {% nav entry in craft.entries.section('myStructureSectionHandle') %}
      <li>
          <a href="{{ entry.url }}">{{ entry.title }}</a>
          {% ifchildren %}
              <ul>
                  {% children %}
              </ul>
          {% endifchildren %}
      </li>
  {% endnav %}
  
  ```
  
  Beyond this, I think your question is a bit too open-ended to answer in detail, and you should probably create separate questions for any specific issues or problems you encounter working with Structures.
  
  
  ---
  
  