Skip to content
davydotcom edited this page Nov 13, 2012 · 8 revisions

Spud CMS Supports several configuration options in your environment.rb file.

Spud::Cms.configure do |config|
    config.root_page_name = "home"
    config.menus_enabled = true
    config.default_page_layout = 'application'
    config.yield_body_as_content_block = false    
    config.enable_sitemap = true
    config.cache_mode = nil #Options :full_page, :action
end

The above code block could be copied in your environment.rb file as these are the default values. But what do they all do you may ask?

config.root_page_name = "home"

This is the url friendly name of the page in the cms that will be routed to your root_url().By url friendly i mean the parameterized/lowercased/hyphenated name. (i.e. "about-us" would be the name for the page titled "About Us").

config.menus_enabled = true

The menus_enabled feature enables the menu management tool in spud_admin. This allows you to build menus and render them in ul/li blocks on the page using the sp_list_menu() helper.

config.default_page_layout = 'application'

This configuration option is fairly self explanatory, but it lets the cms engine know which erb layout to use for the default page template.

config.yield_body_as_content_block = false

This allows you to force the cms engine to render the "Body" page part as a content_for block instead of a standard yield method.

config.enable_sitemap = true

This enables the sitemap generator with the route: /spud/cms/sitemap.xml. It also adds this to the sitemap index at /spud/sitemap.xml for optimal seo.

config.cache_mode = nil

This configures the cache mode you would like spud_cms to use. Valid options are :full_page for full page caching, and :action for action caching. Leaving this value as nil will disable caching for cms pages. (enabling caching is not recommended if you have dynamic content in your layouts)