Sha256: ba79ef7452d3b10a0aa482f2abadef15e1cab5508df9a9fd0e21bf71e5d5446e

Contents?: true

Size: 1.22 KB

Versions: 2

Compression:

Stored size: 1.22 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:
  menu ||= []
  crumbs ||= [{
    body: controller_name.titleize,
    url: {controller: controller_name, action: :index}
  }]
  crumbs += Array(add_crumbs) if defined?(add_crumbs)


#wcms_site_navigation
  .container
    - if menu.present?
      .dropdown.custom-dropdown
        a.dropdown-toggle href='#' data-toggle='dropdown' role='button' Menu
        ul.dropdown-menu
          - menu.each do |link|
            = nav_link(link[:body], link[:url])
    - else
      = link_to 'Home', root_url, class: 'top-nav-link'

    - crumbs.each do |crumb|
      i class='fa fa-angle-right'
      = link_to crumb[:body], crumb[:url], class: 'top-nav-link'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
biola_wcms_components-0.1.0 app/views/wcms_components/navigation/_site_nav.html.slim
biola_wcms_components-0.0.1 app/views/wcms_components/navigation/_site_nav.html.slim