I am having different theme HTML files for different site sections. There are some major layout differences depending if the page is the front page, or a certain subsection.
As far as I see the default behavior is just to have one HTML file:
http://pypi.python.org/pypi/collective.xdv#usage
What would be the best strategy to use multiple theme files, slight rule variations and collective.xdv?
Plone 4.1b.
We usually just utilize plain xdv and use the
rules.xml
(or whatever you want to call it) file to setup the theme templates leaving the corresponding properties in the collective.xdv controlpanel empty. Nesting rules gives you quite some fexibility when asigning different templates:My personal Plone site uses different theme and rules files for different parts.
Are you using the XDV control panel at /@@xdv-settings?
In the Theme template and Rules File fields I put my default (i.e most used) files.
In the Alternate Themes textbox you can then provide alternate theme and rules files depending on a given path.
The format is path theme rules.
Here are some examples from my website's config:
As you can see, you can use regular expression syntax to match the paths.
The first line is for styling the login and logout pages. The second for styling only my blog's landing page (henche the $) the third styles my software page.
Works like a charm.
You should use the Alternate Themes settings to define alternative layouts when the url matches a specific regular expression.
For example, we have a Plone site named "Plone" and accessible at url localhost:8080/Plone. To provide a different layout for the Home page, we can define the following in the registry (or TTW in the Plone Control Panel > XDV Settings section):
This way, the home page will use the alternative layout, while all the other pages will use the main layout specified in Theme template and Rules template
You can provide multiple definitions according to the different sections of your site.