Skip to content

Rock For Theme Builders

Jon Edmiston edited this page Aug 6, 2013 · 11 revisions

Theming Conventions

One of the design objectives for Rock was the ability to quickly and easily change the theme of an external site without having to change a lot of block settings and HTML. Our goal was for a customer to be able to change the theme setting for an entire site and the whole site design updates. To enable this level of theming a few conventions must be upheld. Each convention is discussed below.

(rough notes to be fleshed out later)

Layout & Zone Names

Layout names must be consistent so that themes all implement the same standard set of layouts. Within each theme the names of the various zones must also be consistent so that the blocks from each page know where to load when the theme is changed.

The standard layouts for external sites are listed below with the names of zones internal to the layout:

Homepage

  • Header
  • Navigation
  • PromotionRotator
  • PromotionList
  • Footer

XSLT Files

XSLT files are used to define the markup of navigation menus and marketing ad promotion rotators / displays. These files should all be stored in the folder /Assets/Xslt under the theme root. Common naming conventions should be used to allow theme changes without setting changes. The standard XSLT file names are lised below.

  • HomepagePromotionRotator.xslt - used on the homepage to provide markup for a promotions rotator.
  • HomepagePromotionList.xslt - used for sub-promotions or other lists of promotions.
  • PrimaryNavigation.xslt - provides the page's primary navigation on the page.
  • SubNavigation.xslt (optional) - provides an optional sub navigation for a page

Theme Paths

When designing your themes it is important not to hard-code paths to assets in your block and page settings. For example, if you need to reference an XSLT file in the navigation, it would be unwise to link to ~/Theme/<SpecificThemeName>/Assets/Xslt/PageNavigation.xslt. When the theme is changed you would need to go back and edit all of these settings. Instead, use the theme home notation of ^/Assets/Xslt/PageNavigation.xslt (this is currently a proposal). This matched with standard XSLT names enables fast and painless theme changing.

Clone this wiki locally