Sha256: 3916d2ef7a7cd8b93749296955263b439b3acbc9f692ea53fe919f07ab29f1d7

Contents?: true

Size: 1.9 KB

Versions: 50

Compression:

Stored size: 1.9 KB

Contents

module Tags::NavigationTags
  include TrustyCms::Taggable


  desc %{One Column Subnavigation Tag

          *Usage:*
<pre><r:subnav_one_column /></pre>
}
  tag "subnav_one_column" do |tag|
    request.env["action_controller.instance"].render_to_string :partial => "navigation/subnav_one_column",
                                                               :locals => {:current_page => tag.locals.page,
                                                                           :top_level_page => top_level_page(tag.locals.page)}
  end

  desc %{Two Column Subnavigation Tag

          *Usage:*
<pre><r:subnav_two_column /></pre>
}
  tag "subnav_two_column" do |tag|
    request.env["action_controller.instance"].render_to_string :partial => "navigation/subnav_two_column",
                                                               :locals => {:current_page => tag.locals.page,
                                                                           :top_level_page => top_level_page(tag.locals.page)}
  end

  desc %{Three Column Subnavigation Tag

          *Usage:*
<pre><r:subnav_three_column show_detail="true" /></pre>

show_detail will display the page abstract and a Read More link.
}
  tag "subnav_three_column" do |tag|

    request.env["action_controller.instance"].render_to_string :partial => "navigation/subnav_three_column",
                                                               :locals => {:current_page => tag.locals.page,
                                                                           :top_level_page => top_level_page(tag.locals.page),
                                                                           :show_detail => show_detail(tag.attr["show_detail"])}
  end


  def top_level_page(page)
    page = page.parent while page.parent.slug != '/'
    page
  end

  def show_detail(show_detail)
    if show_detail
      return show_detail.downcase == "true" ? true : false
    end
  end

end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.3.29 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.28 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.27 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.26 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.25 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.24 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.23 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.22 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.21 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.20 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.19 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.18 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.17 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.16 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.15 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.14 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.13 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.12 lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.11g lib/tags/navigation_tags.rb
trusty-festivity-extension-2.3.10 lib/tags/navigation_tags.rb