This part of the 4.x documentation is for eZ Publish 4.0, only reference section is common for all eZ Publish 4.x versions as well as eZ Publish 5.x "LegacyStack", please select the version you are using for the most up to date documentation!
A siteaccess may make use of several designs. This means that the final result generated by eZ Publish (the actual HTML) can be a combination of files originating from various designs. A siteaccess is capable of using a combination of the following:
- One main design
- None or several additional designs
- One standard design
A siteaccess should always have at least a main design and a standard design. While the main design can be set to anything, the standard design should not be modified. The default configuration is to use the built-in standard design. It ensures that eZ Publish always finds the necessary templates and thus any kind of content can be rendered without problems. A more in-depth explanation is presented below.
If eZ Publish is unable to find a design specific file (a stylesheet, a template, an image, etc.) within the main design, it will automatically attempt to locate the file elsewhere. The system will sequentially go through all the additional designs (if specified), looking for the requested file. At last, if the requested file still hasn't been found, eZ Publish will attempt to locate the missing file within the standard design. The following diagram illustrates this functionality.
The design fallback mechanism.
The different designs to be used by must be defined in the "[DesignSettings]" block within an override for the "site.ini" configuration file. The following directives can be used:
The "SiteDesign" directive specifies the main design. The "AdditionalSiteDesignList" directive specifies an array of additional site designs. The "StandardDesign" directive specifies the standard design. Even though it is possible to change the standard fallback design, it is not a good idea to do so. The "StandardDesign" directive should always be set to the built-in standard design. This is already defined in the default "site.ini" file and thus there is no need to set the standard design from within an override. If there is a need for a custom fallback design, it should be specified using the "AdditionalSiteDesignList" setting. The automatic fallback mechanism opens up for a lot of possibilities and flexibility. For example, it makes the reuse and combination of designs an easy matter.
The following example shows how to configure the following design settings in an override for the "site.ini" configuration file:
- "my_design" should be the main design
- "fallback_one" should be the first additional design
- "fallback_two" should be the second additional design
- "standard" should be the standard fallback design
... [DesignSettings] SiteDesign=my_design AdditionalSiteDesignList=fallback_one AdditionalSiteDesignList=fallback_two StandardDesign=standard ...
In this particular case, if eZ Publish is unable to find the requested file within the main design "my_design", it will automatically fallback to the additional designs. At first, the system will look for the requested file within the "fallback_one" design directory. If the requested file is not found, the system will look in the "fallback_two" design directory. If the file still hasn't been found, the system will attempt to locate it within the "standard" design directory. The standard directory will most likely contain the requested file (unless a custom template/override is requested).
Balazs Halasy (07/02/2005 1:07 pm)
Ricardo Correia (17/04/2013 10:27 am)