Class: Weaver::NavPage

Inherits:
StructuredPage show all
Defined in:
lib/weaver/page_types/nav_page.rb

Overview

Pages with navigation menus

Direct Known Subclasses

SideNavPage, TopNavPage

Instance Attribute Summary

Attributes inherited from Page

#favicon_name, #favicon_type, #onload_scripts, #scripts

Instance Method Summary collapse

Methods inherited from StructuredPage

#header, #row

Methods inherited from Page

#background, #create_anchor, #generate, #on_page_load, #request_css, #request_js, #root, #set_favicon_path, #set_favicon_type, #top, #write_script_once

Constructor Details

#initialize(title, global_settings, options, &block) ⇒ NavPage

Returns a new instance of NavPage.



7
8
9
10
# File 'lib/weaver/page_types/nav_page.rb', line 7

def initialize(title, global_settings, options, &block)
  super
  @menu = Menu.new
end

Instance Method Details

#brand(text, link = '/') ⇒ Object



16
17
18
19
# File 'lib/weaver/page_types/nav_page.rb', line 16

def brand(text, link = '/')
  @brand = text
  @brand_link = link
end


12
13
14
# File 'lib/weaver/page_types/nav_page.rb', line 12

def menu(&block)
  @menu.instance_eval(&block)
end