module Webgen::Tag::Menu

Generates a menu that can be extensively configured by using the available Webgen::NodeFinder options.

Public Class Methods

call(tag, body, context) click to toggle source

Generate the menu.

   # File lib/webgen/tag/menu.rb
12 def self.call(tag, body, context)
13   options = context[:config]['tag.menu.options']
14 
15   context[:nodes] = context.website.ext.node_finder.find(options, context.content_node)
16   context.website.ext.item_tracker.add(context.dest_node, :nodes, :node_finder_option_set,
17                                        {:opts => options, :ref_alcn => context.content_node.alcn},
18                                        context[:config]['tag.menu.tracking_style'])
19 
20   if context[:nodes].empty?
21     ''
22   else
23     Webgen::Tag.render_tag_template(context, "menu")
24   end
25 end
menu_item_details(dest_node, node, lang, level, has_submenu, config) click to toggle source

Return style information (node is selected, …) and a link from dest_node to node.

This method can be used in a menu template.