Sha256: 373c93697724a5f12e23a58962eba6a40c8a4ba61873ec55318d4efe7e74a906
Contents?: true
Size: 1.57 KB
Versions: 1
Compression:
Stored size: 1.57 KB
Contents
/ Parameters / menu: Array of hashes. This is what goes in the dropdown menu / body: This is the link text / url: This is where the link will go. Gets processed by url_for() / crumbs: (optional) Array of hashes. These are the crumbs after the main menu / add_crumbs: (optional) Array of hashes. These get pushed onto the default crumbs / / Example: / = wcms_component('navigation/site_nav', { menu: [ \ / {body: 'Academic Programs', url: :academic_programs_path}, / {body: 'Schools', url: :schools_path}, / {body: 'ULOs', url: :university_learning_outcomes_path}, / ]}) / ruby: site_name ||= "Menu" # This will be "WCMS" or "News Publisher", etc. menu ||= [] default_crumbs = [] # Set @parent if you have nested routes. _root_controller = @parent ? @parent.class.to_s.tableize : controller_name default_crumbs = [{ body: _root_controller.titleize, url: {controller: _root_controller, action: :index} }] crumbs ||= default_crumbs crumbs += Array(add_crumbs) if defined?(add_crumbs) #wcms_site_navigation .container = link_to fa_icon('home'), '/', class: 'top-nav-link' - if menu.present? i class='fa fa-angle-right' .dropdown.custom-dropdown a.dropdown-toggle href='#' data-toggle='dropdown' role='button' = site_name ul.dropdown-menu - menu.each do |link| = nav_link(link[:body], link[:url]) li.divider li.descendant = link_to 'View all', '/' - crumbs.each do |crumb| i class='fa fa-angle-right' = link_to crumb[:body], crumb[:url], class: 'top-nav-link'
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
biola_wcms_components-0.18.1 | app/views/wcms_components/navigation/_site_nav.html.slim |