Skip to content

Commit

Permalink
Added custom navigation snippet that displays category entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirklectisch committed Mar 24, 2014
1 parent 14ff264 commit aa9d781
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 17 deletions.
18 changes: 1 addition & 17 deletions app/views/pages/index.liquid
Expand Up @@ -17,23 +17,7 @@ published: true
<a href="/">
<img class="logo" src="{{ 'logo.png' | theme_image_url }}"/>
</a>
{% nav site, depth: 2, no_wrapper: false, exclude: nil, icon: false %}
<!-- nav class="global">
<ul>
<li><a href="#">Nieuws</a></li>
<li>
<a href="#">Cursussen</a>
<ul>
<li><a href="#">Interieur</a></li>
<li><a href="#">Mode</a></li>
<li><a href="#">Wedding</a></li>
</ul>
</li>
<li><a href="#">Partners</a></li>
<li><a href="#">Docenten</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav-->
{% include 'navigation' %}
</header>
<img class="mast" src="{% editable_file 'masthead' %}http://placehold.it/979x569{% endeditable_file %}">
<div id="main">
Expand Down
41 changes: 41 additions & 0 deletions app/views/snippets/navigation.liquid
@@ -0,0 +1,41 @@
<nav class="global">
<ul>
{% for child in site.index.children %}
{% if child.published? and child.listed? %}
<li>
<a href="/{{ child.fullpath }}">{{ child.title }}</a>
<ul>
{% for grandchild in child.children %}
{% if grandchild.published? and grandchild.listed? %}
{% if grandchild.templatized? %}
{% for entry in contents.categories %}
<li><a href="/{{ grandchild.parent.fullpath }}/{{ entry._permalink }}">{{ entry._label }}</a></li>
{% endfor %}
{% else %}
<li><a href="/{{ grandchild.fullpath }}">{{ grandchild.title }}</a></li>
{% endif %}
{% endif %}
{% endfor %}
</ul>
</li>
{% endif %}
{% endfor %}
</ul>
</nav>

<!-- nav class="global">
<ul>
<li><a href="#">Nieuws</a></li>
<li>
<a href="#">Cursussen</a>
<ul>
<li><a href="#">Interieur</a></li>
<li><a href="#">Mode</a></li>
<li><a href="#">Wedding</a></li>
</ul>
</li>
<li><a href="#">Partners</a></li>
<li><a href="#">Docenten</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav-->

0 comments on commit aa9d781

Please sign in to comment.