Fixed submenu

This commit is contained in:
saurabhbhatia 2013-11-22 13:12:31 +08:00
parent 9428171859
commit 66d0adf628
1 changed files with 12 additions and 8 deletions

View File

@ -1,19 +1,23 @@
<% if @menu_page %>
<% if @menu_page.children.present? %>
<div class='category_list'>
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
<ul class='list'>
<% @menu_page.visible_children.each do |child| %>
<% if @menu_page.visible_children.nil?%>
<p>Test</p>
<li class="<%= @page_id.eql?(child.parent.id) ? 'active' : nil %>">
<a href="<%= (child.parent.class.to_s.eql?('Page') ? '/' + child.parent.path : child.parent.url) %>"><%= child.parent.title %></a>
</li>
<% else %>
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
</li>
<% end %>
<% end %>
</ul>
</div>
<% else %>
<div class='category_list'>
<!-- <h3 class='h3'><%#= @menu_page.title %></h3> -->
<ul class='list'>
<% @menu_page.parent.visible_children.each do |child| %>
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
</li>
<% end %>
</ul>
</div>