ez.no / ezpublish / documentation / customization / custom design / introduction
These documentation pages are no longer maintained. Please visit the new documentation site.
All design are placed in the design/ directory in the eZ publish root directory. We have one sub-directory placed in the design/ directory for each design. The design directory that is used for the specific site access is defined with the SiteDesign variable in the DesignSettings block in your configuration file.
settings/siteaccess/user/site.ini.append:
[DesignSettings] SiteDesign=user
eZ publish will now search for the design in design/user/. We can have several sub-directories of our design directory:
|
Directory |
Description |
|---|---|
|
templates/ |
Main templates for our site design |
|
templates/node/view/ |
Templates for viewing the actual nodes |
|
images/ |
Directory for your design images |
|
stylesheets/ |
Default placement for css files |
|
override/ |
Directory for placement of templates overriding the default template directory |
If eZ publish doesn't find a matching template in our design directory, it will use the standard design. Which design that is used as a standard design is set by the StandardDesign setting in the DesignSettings block.
We recommend that you don't change this setting, and use standard as standard design. This design has all templates you need created by eZ systems. You should therefore leave this as it is and only create the templates you need and place them in your design directory.
Templates are normal HTML with eZ publish specific code. All eZ publish code are placed inside curly braces.
<html> <body> {'this is eZ publish code'} {* This is a comment *} </body> </html>
This will output:
this is eZ publish code
Comments are placed inside {* and *}. The difference between this and HTML comments is that the eZ publish comments are stripped away on the server by the parser and is not visible in the HTML code.
Since eZ publish uses { and } to declare tags, we can get into troubles if we wish to print these tags directly on the web page (i.e. if we want a javascript on our page). To avoid this we can use the literal tag. Everything inside a literal tag will be parsed directly as it is by the template engine.
Example:
<script language="JavaScript"> <!-- {literal} function OpenWindow ( URL, WinName, Features ) { popup = window.open ( URL, WinName, Features ); if ( popup.opener == null ) { remote.opener = window; } popup.focus(); } {/literal} // --> </script> <H1>{$node.name}</h1>
Kernel operators are used to transform strings. This can be used to translate text to different languages, fetch correct path and so on. The operators take input through a pipe in the same way as with standard input in a Unix shell.
|
Kernel operator |
Description |
|---|---|
|
ezurl |
Makes sure that the url works for both virtual hosts and non-virtual host setups. |
|
ezroot |
Similar to ezurl but does not include the index.php |
|
ezsys |
Returns values from ezsys. The available values are wwwdir, sitedir, indexfile, indexdir and imagesize |
|
ezdesign |
Similar to ezroot but prefixes with the current design directory |
|
ezimage |
Similar to ezroot but prefixes image directory in the current design |
|
i18n |
Marks a string for translation |
|
x18n |
Marks a string in an extension template for translation |
Example:
<link rel="stylesheet" type="text/css" href={"stylesheets/core.css"|ezdesign} />
We send the string stylesheets/core.css to the ezdesign operator. ezdesign will append full path to the design directory to this string. It will first check our site design directory for the file, if it is found, it will append the path to this directory, if not it uses the standard design directory.
Output:
<link rel="stylesheet" type="text/css" href="/design/standard/stylesheets/core.css" />
All links on your site should use one of these operator. By doing we ensure that all url's are correct even if we move our installation to another domain or sub-directory on the server.
It is defined a lot more operators. This is operators for logical and arithmetic operations. For more information about these, go to http://ez.no/ez_publish/documentation/reference/template_operators
Comments
Wrong word about the example
James Ashley
Tuesday 09 August 2005 4:01:41 am
ezdesign}") said the path would be appended to whatever was passed to it.
Assuming the example's correct, the value returned from ezdesign gets prepended onto whatever was piped into it. It's an important difference.
link broken ?
Ad Weterings
Monday 17 January 2005 10:53:28 am
cannot find operators
Ad Weterings
Monday 17 January 2005 10:42:49 am
seems to be broken.