Home / CMS/DMS : eZ publish / Design guide / Design extension

Design extension

With eZ publish, you can fine tune the look & feel of your website by creating your own design extension.

A design extension must have the following structure;

  • <my design>
  • ezinfo.php - Information for the ezinfo/about URL
    • design
      • <my design>
        • images - All images used by the extension and it's stylesheets
        • javascript - All javascripts used by the extension
        • override
          • templates - All templates 'that override a template override'
        • stylesheets - All stylesheets used by the extension
        • templates - All templates that override current templates
    • settings - All stylesheets used by the extension such as;
      • site.ini.append.php
      • design.ini.append.php

Settings

site.ini.append.php

<?php /*
[TemplateSettings]
ExtensionAutoloadPath[]=<my design>
*/ ?>

design.ini.append.php

<?php /* #?ini charset="utf-8"?
# eZ publish configuration file for modules

[ExtensionSettings]
DesignExtensions[]=<my design>

[StylesheetSettings]
CSSFileList[]=<name of the css file for my design>
*/ ?>

Templates

To replace a current template just create a new template with the same name at the same location (in the 'my design/templates' or in the 'my design/override/templates'). Using this technique, you don't need to create an override.

Overriding styles

The CSS and templates are applied according to the order set in the design.ini.append.php file from the siteaccess.

[DesignSettings]
SiteDesign=<my design>
AdditionalSiteDesignList[]
AdditionalSiteDesignList[]=<my extra design>
AdditionalSiteDesignList[]=ezwebin
AdditionalSiteDesignList[]=base

Any .css or .tpl file from <my design> will override the equivalent files from <my extra design>, ezwebin, base

Overriding settings

Several siteaccess can use the same design extension, therefore, the .ini files in the siteacces will override the .ini file of the extension

Nota

The way to manage design extension described above is not the standard way of eZ Publish. According to eZ Systems, you should create a design package and upload it using the admin interface.

The trouble with this method is that you should reupload the whole extension for each changes. This is why we are not using it.

By placing your source code, as described, you will be able to manage and edit the code, specially the css files, much more efficiently.

Just take note that if you are already using a standard eZ Publish design packages that the css files from this package will override yours unless you do the following changes in the 'page_head_style.tpl' file. This code MUST be placed as the last line before the clossing </style> tag.

{foreach ezini( 'StylesheetSettings', 'CSSFileList', 'design.ini' ) as $css_file}
    @import url({concat( 'stylesheets/', $css_file )|ezdesign});
{/foreach}