1

We currently have a web server with many subdomains setup that are individually themed with a <match> statement.

eg: 1.abc.com, 2.abc.com etc.

The deliverance.xml file (rules file) has the following rules:

<match domain="1.abc.com" class="1" />
<match domain="2.abc.com" class="2" />
<rules class="1">
  <!-- some rules for 1.abc.com -->
</rules>
<rules class="2">
  <!-- rules for 2.abc.com -->
</rules>

Due to the nature of these subdomains, there is very little difference visually between each sub domain (a logo may change, or the colour of the footer, etc - nothing huge)

Because of this I must include the same rules for 1.abc.com as I do for 2.abc.com (things like replacing the style, inserting content etc).

As a result my rules file is fast becoming humongous with duplicated rules and although it works, it is rather messy and needlessly repetitive.

I seem to remember finding somewhere, some documentation that explained how I can say to Deliverance "Include this rules file". What I mean is that I could write a rules file for the bulk of the rules, and write individual files for each subdomains footer & logo changes, something like this (only as an example, I am not sure of the actual command):

You can find the deliverance documentation here, but I can find anything regarding an include statement.

<match domain="1.abc.com" class="1" />
<match domain="2.abc.com" class="2" />
<rules class="1">
  <include href="[PATH TO GENERIC RULES FILE]"/>
  <!-- some rules for 1.abc.com -->
</rules>
<rules class="2">
  <include href="[PATH TO GENERIC RULES FILE]"/>
  <!-- rules for 2.abc.com -->
</rules>

This would enable me to have a much neater rules file with very little repetition.

Does anyone have any ideas? I must stress although this has the tag Plone this question is regarding Deliverance NOT Diazo! - as Diazo has a few more commands than Deliverance.

EDIT:

I have also tried this command: <xi:include href="generic-deliverance.xml" />

So to confirm my rules look like:

<match domain="1.abc.com" class="1" />
<match domain="2.abc.com" class="2" />
<rules class="1">
  <xi:include href="generic-deliverance.xml" /> 
  <!-- some rules for 1.abc.com -->
</rules>
<rules class="2">
  <xi:include href="generic-deliverance.xml" /> 
  <!-- rules for 2.abc.com -->
</rules>

However that breaks Deliverance and when I browse to any of the subdomains I get:

Server Error
An error occurred. See the error logs for more information. 
(Turn debug on to display exception reports here) 

I also included this as my rules statement:

<rules xmlns:xi="http://www.w3.org/2001/XInclude" 
 xmlns="http://www.plone.org/deliverance"> 

However that broke Deliverance also.

Any thoughts welcome!

Dan
  • 958
  • 2
  • 11
  • 25
  • 1
    maybe a helpful reference: http://www.thijs.biz/2013/02/06/diazo-theme-inheritance/ – vangheem Mar 04 '13 at 22:24
  • Thanks for your link, it seems slightly more Diazo related but I'll read it in more depth shortly. – Dan Mar 05 '13 at 09:52

0 Answers0