Answers.Body: <p>This was on my first craft site (<a href="http://patisseriejanandries.com" rel="nofollow">http://patisseriejanandries.com</a>) so this is a 'warts and all' example. </p>
  
  <p>Productpages was a structure, news a channel, the other pages were singles. The 'nieuwsindex' single is there because I needed a translatable url for the news page, so that single served as a workaround. (more on that here: <a href="https://plus.google.com/116942350387086245334/posts/TBtR3XwuZGx" rel="nofollow">https://plus.google.com/116942350387086245334/posts/TBtR3XwuZGx</a>)
  You're still basically hardcoding the nav, but craft does take care of the multi-language urls, pretty nice if you ask me.</p>
  
  <p>The nav template looked like this (which IMO isn't <em>that</em> bad for a first try :) )</p>
  
  <pre><code>   {# set values for the navigation #}
     {# products = structure #}
     {% set productpages = craft.entries.section('productPages').depth(1).find() %}
     {# singles #}
     {% set contact = craft.entries.section('contact').find() %}
     {% set overjanandries = craft.entries.section('overJanAndries').find() %}
     {% set overview = craft.entries.section('overview').find() %}
     {% set news = craft.entries.section('nieuwsIndex').find() %}
  
  
      &lt;div id="menu"&gt;
        &lt;a class="close"&gt; &lt;span class="menu-icon icon-cancel"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;nav role="navigation"&gt;
        &lt;ul&gt;
          {% for page in overview %}
            &lt;li&gt;{{ page.getLink() }}&lt;/li&gt;  
          {% endfor %}
          {% for page in overjanandries %}
            &lt;li&gt;{{ page.getLink() }}&lt;/li&gt;  
          {% endfor %}
          {% for page in productpages %}
           &lt;li&gt;{{ page.getLink() }}&lt;/li&gt;  
          {% endfor %}
           {% for page in news %}
            &lt;li&gt;{{ page.getLink() }}&lt;/li&gt;  
          {% endfor %}
          {% for page in contact %}
            &lt;li&gt;{{ page.getLink() }}&lt;/li&gt;  
          {% endfor %}
        &lt;/ul&gt;
        &lt;/nav&gt;
      &lt;/div&gt;&lt;!-- menu --&gt;
  </code></pre>
  
  <p>Following Christian's suggestions I've amended my code and added a 'current' class.
  This is working fine (and probably cuts down on DB calls):</p>
  
  <pre><code>{# set values for the navigation #}
  {# products = structure #}
  {% set productpages = craft.entries.section('productPages').depth(1).find() %}
  {# singles #}
  {% set contact = craft.entries.section('contact').first() %}
  {% set overjanandries = craft.entries.section('overJanAndries').first() %}
  {% set overview = craft.entries.section('overview').first() %}
  {% set news = craft.entries.section('nieuwsIndex').first() %}
  {% set section = craft.request.getSegment(1) %}
  
  
  &lt;div id="menu"&gt;
    &lt;a class="close"&gt; &lt;span class="menu-icon icon-cancel"&gt;&lt;/span&gt;&lt;/a&gt;
    &lt;nav role="navigation"&gt;
    &lt;ul&gt;
      &lt;li {% if section == overview.uri %}class="current"{% endif %}&gt;{{ overview.getLink() }}&lt;/li&gt;  
      &lt;li {% if section == overjanandries.uri %}class="current"{% endif %}&gt;{{ overjanandries.getLink() }}&lt;/li&gt;  
      {% for page in productpages %}
       &lt;li {% if section == page.uri %}class="current"{% endif %}&gt;{{ page.getLink() }}&lt;/li&gt;  
      {% endfor %}
      &lt;li {% if section == news.uri %}class="current"{% endif %}&gt;{{ news.getLink() }}&lt;/li&gt;  
      &lt;li {% if section == contact.uri %}class="current"{% endif %}&gt;{{ contact.getLink() }}&lt;/li&gt;  
    &lt;/ul&gt;
    &lt;/nav&gt;
  &lt;/div&gt;&lt;!-- menu --&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T11:41:50.037Z
Answers.Text: Not bad at all, Erwin! First thing I'd do to further improve on it is to get rid of those for loops to output links to your singles (use `first()` on the entry query).
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T12:05:59.713Z
Answers.Text: I'm giving this one a go because the way my entries are set up in the back end is close to this, but when I view my nav, I get English title output for both languages (although it does output the correct URL slug for the Czech site).
Answers.UserDisplayName: Tyssen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T12:09:02.303Z
Answers.Text: Also, how would you add an 'active/current/here' class to the link?
Answers.UserDisplayName: Tyssen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T13:02:24.190Z
Answers.Text: @Tyssen exchange `getLink()` with `getUrl()` and `title()` to better control the html output for your links. Then you can also add CSS classes `class="myDefaultClass{{ craft.request.firstSegment == 'mySectionHandle' ? ' current' }}`
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T13:07:08.277Z
Answers.Text: Oh and I'd definitely think twice about not doing the switch to a "pages" structure. Single content is probably easy to copy over and you can also reuse your fields!
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T13:11:58.120Z
Answers.Text: Using getURL & title will give me more control over the HTML but it's still outputting English titles but translated URLs. :? What am I missing to get that working?
Answers.UserDisplayName: Tyssen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T13:41:50.813Z
Answers.Text: @Tyssen `{{ mySectionHandle.title }}` should always output the title in the current locale as set in the sections settings.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T21:20:29.183Z
Answers.Text: Sorted it out now; had forgotten that I'd needed a separate 'heading' field for my singles as you can't currently have translations for title fields for singles.
Answers.UserDisplayName: Tyssen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T11:10:23.840Z
Answers.LastActivityDate: 2014-07-10T13:10:35.467Z
Answers.LastEditDate: 2014-07-10T13:10:35.467Z
Answers.UserDisplayName: erwinheiser
Answers.Body: <p>I have one main structure "pages" and got rid of all single sections. I also gave each channel's index page an entry in the structure (good for URL translation). Then I added some entry types to it (you can also <a href="http://buildwithcraft.com/help/entry-type-templates">link templates</a> to them) and created my site navigation like in my example code below.</p>
  
  <p>This allows you to translate the slug of the index pages in the CP and you have access to localized URL (<code>page.getUrl</code>) and page title variables (<code>page.title</code>) in your nav template.</p>
  
  <p>Only one level of hierarchy I need. If you have to go deeper, the <a href="http://buildwithcraft.com/docs/templating/tags#nav"><code>nav</code></a> tag's waiting for you! ;)</p>
  
  <pre><code>{# Get top-level entries in pages structure #}
  {% set pages = craft.entries.section('pages').level(1) %}
  
  &lt;nav class="navigation" role="navigation"&gt;
      &lt;ul&gt;
  
          {# Loop through entries (= pages) and list the links #}
          {% for page in pages %}
              &lt;li class="navigation-item"&gt;
                  &lt;a href="{{ page.getUrl }}"&gt;{{ page.title }}&lt;/a&gt;
              &lt;/li&gt;
          {% endfor %}
  
          {# Include links to switch locales #}
          &lt;li class="navigation-item"&gt;
              {% include '_includes/language_switch.html' %}
          &lt;/li&gt;
  
      &lt;/ul&gt;
  &lt;/nav&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T11:12:22.010Z
Answers.Text: pretty solid approach, nice one.
Answers.UserDisplayName: erwinheiser
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-10T03:29:01.650Z
Answers.LastActivityDate: 2014-07-10T10:48:23.880Z
Answers.LastEditDate: 2014-07-10T10:48:23.880Z
Answers.UserDisplayName: carlcs
Body: <p>Does anyone have any examples of how they've put together the main site navigation for a multi-lingual site set-up made up of singles, channels and structure?</p>
  
  <p>At the moment I've just hard-coded the nav and done and if else on the locale ID but would like to know if there's a more flexible, future-proof method.</p>
  
Tags: <navigation><localization>
Title: Multi-lingual site navigation made of singles, channels and structure
ThreadText: # Multi-lingual site navigation made of singles, channels and structure
  
  (Asked by: username_0 on 2014-07-10)
  
  Does anyone have any examples of how they've put together the main site navigation for a multi-lingual site set-up made up of singles, channels and structure?
  
  At the moment I've just hard-coded the nav and done and if else on the locale ID but would like to know if there's a more flexible, future-proof method.
  
  **Tags:** navigation, localization
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2014-07-10. Score: 3 | Accepted answer
  
  This was on my first craft site (<http://patisseriejanandries.com>) so this is a 'warts and all' example.
  
  Productpages was a structure, news a channel, the other pages were singles. The 'nieuwsindex' single is there because I needed a translatable url for the news page, so that single served as a workaround. (more on that here: <https://plus.google.com/116942350387086245334/posts/TBtR3XwuZGx>)
  You're still basically hardcoding the nav, but craft does take care of the multi-language urls, pretty nice if you ask me.
  
  The nav template looked like this (which IMO isn't *that* bad for a first try :) )
  
  ```
     {# set values for the navigation #}
     {# products = structure #}
     {% set productpages = craft.entries.section('productPages').depth(1).find() %}
     {# singles #}
     {% set contact = craft.entries.section('contact').find() %}
     {% set overjanandries = craft.entries.section('overJanAndries').find() %}
     {% set overview = craft.entries.section('overview').find() %}
     {% set news = craft.entries.section('nieuwsIndex').find() %}
  
      <div id="menu">
        <a class="close"> <span class="menu-icon icon-cancel"></span></a>
        <nav role="navigation">
        <ul>
          {% for page in overview %}
            <li>{{ page.getLink() }}</li>  
          {% endfor %}
          {% for page in overjanandries %}
            <li>{{ page.getLink() }}</li>  
          {% endfor %}
          {% for page in productpages %}
           <li>{{ page.getLink() }}</li>  
          {% endfor %}
           {% for page in news %}
            <li>{{ page.getLink() }}</li>  
          {% endfor %}
          {% for page in contact %}
            <li>{{ page.getLink() }}</li>  
          {% endfor %}
        </ul>
        </nav>
      </div><!-- menu -->
  
  ```
  
  Following Christian's suggestions I've amended my code and added a 'current' class.
  This is working fine (and probably cuts down on DB calls):
  
  ```
  {# set values for the navigation #}
  {# products = structure #}
  {% set productpages = craft.entries.section('productPages').depth(1).find() %}
  {# singles #}
  {% set contact = craft.entries.section('contact').first() %}
  {% set overjanandries = craft.entries.section('overJanAndries').first() %}
  {% set overview = craft.entries.section('overview').first() %}
  {% set news = craft.entries.section('nieuwsIndex').first() %}
  {% set section = craft.request.getSegment(1) %}
  
  <div id="menu">
    <a class="close"> <span class="menu-icon icon-cancel"></span></a>
    <nav role="navigation">
    <ul>
      <li {% if section == overview.uri %}class="current"{% endif %}>{{ overview.getLink() }}</li>  
      <li {% if section == overjanandries.uri %}class="current"{% endif %}>{{ overjanandries.getLink() }}</li>  
      {% for page in productpages %}
       <li {% if section == page.uri %}class="current"{% endif %}>{{ page.getLink() }}</li>  
      {% endfor %}
      <li {% if section == news.uri %}class="current"{% endif %}>{{ news.getLink() }}</li>  
      <li {% if section == contact.uri %}class="current"{% endif %}>{{ contact.getLink() }}</li>  
    </ul>
    </nav>
  </div><!-- menu -->
  
  ```
  
  > **Comments:**
  > **username_2**: Not bad at all, Erwin! First thing I'd do to further improve on it is to get rid of those for loops to output links to your singles (use `first()` on the entry query).  
  > **username_0**: I'm giving this one a go because the way my entries are set up in the back end is close to this, but when I view my nav, I get English title output for both languages (although it does output the correct URL slug for the Czech site).  
  > **username_0**: Also, how would you add an 'active/current/here' class to the link?  
  > **username_2**: @username_0 exchange `getLink()` with `getUrl()` and `title()` to better control the html output for your links. Then you can also add CSS classes `class="myDefaultClass{{ craft.request.firstSegment == 'mySectionHandle' ? ' current' }}`  
  > **username_2**: Oh and I'd definitely think twice about not doing the switch to a "pages" structure. Single content is probably easy to copy over and you can also reuse your fields!  
  > **username_0**: Using getURL & title will give me more control over the HTML but it's still outputting English titles but translated URLs. :? What am I missing to get that working?  
  > **username_2**: @username_0 `{{ mySectionHandle.title }}` should always output the title in the current locale as set in the sections settings.  
  > **username_0**: Sorted it out now; had forgotten that I'd needed a separate 'heading' field for my singles as you can't currently have translations for title fields for singles.  
  
  ---
  
  ### Answer by username_2 on 2014-07-10. Score: 9
  
  I have one main structure "pages" and got rid of all single sections. I also gave each channel's index page an entry in the structure (good for URL translation). Then I added some entry types to it (you can also [link templates](http://buildwithcraft.com/help/entry-type-templates) to them) and created my site navigation like in my example code below.
  
  This allows you to translate the slug of the index pages in the CP and you have access to localized URL (`page.getUrl`) and page title variables (`page.title`) in your nav template.
  
  Only one level of hierarchy I need. If you have to go deeper, the [`nav`](http://buildwithcraft.com/docs/templating/tags#nav) tag's waiting for you! ;)
  
  ```
  {# Get top-level entries in pages structure #}
  {% set pages = craft.entries.section('pages').level(1) %}
  
  <nav class="navigation" role="navigation">
      <ul>
  
          {# Loop through entries (= pages) and list the links #}
          {% for page in pages %}
              <li class="navigation-item">
                  <a href="{{ page.getUrl }}">{{ page.title }}</a>
              </li>
          {% endfor %}
  
          {# Include links to switch locales #}
          <li class="navigation-item">
              {% include '_includes/language_switch.html' %}
          </li>
  
      </ul>
  </nav>
  
  ```
  
  > **Comments:**
  > **username_1**: pretty solid approach, nice one.  
  
  ---
  
  