-
Notifications
You must be signed in to change notification settings - Fork 2
Navigation
effkay edited this page Oct 24, 2014
·
1 revision
Building a navigation is simple, access to the page tree is available through the common methods built into the ancestry gem.
Just make sure you are only accessing published pages for your production site, using the published scope.
Or if your page is translated, using the translated scope and the published scope.
SimpleNavigation::Configuration.run do |navigation|
navigation.items do |primary|
# build first level
Qbrick::Page.roots.published.translated.each do |page|
primary.item page.id, page.title, page.link do |sub_item|
# build second level
page.children.published.translated.each do |subpage|
sub_item.item subpage.id, subpage.title, subpage.link
end
end
end
end
endSimply override the default partial for the main navigation in your app with your own file at qbrick/cms/admin/_main_navigation.html.haml