Created
February 26, 2013 07:51
-
-
Save Darep/5036748 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- source/layouts/layout.html.erb --> | |
<ul class="nav-float products"> | |
<% for cat in data.products.main_categories do %> | |
<li> | |
<h4> | |
<% link_to cat.url do %> | |
<%= cat.name %> | |
<% end %> | |
</h4> | |
<ul> | |
<% for child in cat.category.children do %> | |
<li> | |
<% link_to child.category.url do %> | |
<%= child.category.name %> | |
<% end %> | |
</li> | |
<% end %> | |
</ul> | |
</li> | |
<% end %> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# data/products.yml | |
categories: | |
- category: &id100 | |
name: Kategoria 1 | |
url: /tuotteet/kategoria-1.html | |
children: | |
- category: &id101 | |
name: Alikategoria | |
url: /tuotteet/kategoria-1/alikategoria.html | |
- category: &id102 | |
name: Alikategoria 2 | |
url: /tuotteet/kategoria-1/alikategoria-2.html | |
- category: &id200 | |
name: Jotku tuotteet | |
url: /tuotteet/jotku-tuotteet.html | |
children: | |
- category: &id201 | |
name: Julisteet | |
url: /tuotteet/jotku-tuotteet/julisteet.html | |
- category: &id202 | |
name: Tarrat | |
url: /tuotteet/jotku-tuotteet/tarrat.html | |
main_categories: | |
- *id100 | |
- *id200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment