Module: Cms::SitemapGenerator

Extended by:
MenuHelper, SitemapGenerator
Included in:
SitemapGenerator
Defined in:
lib/bcms_seo_sitemap/cms/sitemap_generator.rb

Instance Method Summary collapse

Instance Method Details

#depthObject

If depth has never been set, it returns nil



25
26
27
# File 'lib/bcms_seo_sitemap/cms/sitemap_generator.rb', line 25

def depth
  configuration.depth || 0
end

#depth=(new_depth) ⇒ Object

These setter and getter methods are probably not needed anymore. Access to Cms::Settings.bcms_seo_sitemap could be done directly from Cms::SitemapsController and that would probably be cleaner.

I’m keeping them here to keep the changes contained to this file only for now.



20
21
22
# File 'lib/bcms_seo_sitemap/cms/sitemap_generator.rb', line 20

def depth=(new_depth)
  configuration.depth = new_depth.to_i
end

#itemsObject



6
7
8
9
10
11
12
# File 'lib/bcms_seo_sitemap/cms/sitemap_generator.rb', line 6

def items
  options = {:page => Page.find_by_path('/'), :show_all_siblings => true}
  if configuration.depth && configuration.depth.nonzero?
    options.merge!({:depth => configuration.depth})
  end
  menu_items(options)
end