eZ Community » Forums » General » Templating....



Wednesday 08 November 2006 1:26:32 pm - 2 replies

I'm new to ez templates, anyhow I would like to create a global variable that I want to be available to all templates. I want to have both Arabic & English sites use the same templates, I kinda have a formula to use the same template for both.

In order to do this, I need to have two variables $dir and $opoDir (opposite dir). The direction should be related to the language, if i'm in the arabic site, dir should "rtl".

How should this be done?

Wednesday 08 November 2006 4:28:53 pm


You should create a siteaccess for your english site and another for your arabic one.

In the arabic siteaccess create a site.ini.append file with the needed settings and add this one:


In the english one, do the same but set the Dir to ltr:


Then in your pagelayout, whenever you need to fetch the direction, you can try this:

{def $dir = ezini( 'SiteSettings', 'Dir', 'site.ini' )}

<html dir="{$dir}">

When user is seeing the english page, the english siteaccess will be loaded and the site.ini setting refearing to the direction will point to ltr. When seeing the arabic, will load rtl.

Wednesday 08 November 2006 4:46:43 pm

If you prefer not to add custom parameters to the site.ini, you can create your own files (eg directionsettings.ini.append.php ).

Modify the template example to fetch it into the right place.



You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from