Module: Nesta::Navigation::Renderers
- Defined in:
- lib/nesta-plugin-metadata-extensions/init.rb
Instance Method Summary collapse
-
#breadcrumb_label(page) ⇒ Object
Override nesta’s breadcrumb_label to show the menu attribute in the breadcrumbs, if given.
-
#display_menu_item(item, options = {}) ⇒ Object
Override nesta’s display_menu_item to show the menu attribute in the menu, if given.
Instance Method Details
#breadcrumb_label(page) ⇒ Object
Override nesta’s breadcrumb_label to show the menu attribute in the breadcrumbs, if given
123 124 125 |
# File 'lib/nesta-plugin-metadata-extensions/init.rb', line 123 def (page) (page.abspath == '/') ? 'Home' : ( page.('menu').nil? ? page.heading : page.('menu') ) end |
#display_menu_item(item, options = {}) ⇒ Object
Override nesta’s display_menu_item to show the menu attribute in the menu, if given
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/nesta-plugin-metadata-extensions/init.rb', line 104 def (item, = {}) if item.respond_to?(:each) if ([:levels] - 1) > 0 haml_tag :li do (item, :levels => ([:levels] - 1)) end end else html_class = (request.path == item.abspath) ? "current" : nil haml_tag :li, :class => html_class do haml_tag :a, :<, :href => item.abspath do haml_concat item. end end end end |