Portal HTML templates design

Documentation applicable for LemonLDAP::NG >= 0.9.3

LemonLDAP::NG skins and HTML::Template Perl module

LemonLDAP::NG templates are designed for HTML::Templates Perl module.

LemonLDAP::NG portal use "skins", located in the skins/ directory of the portal. Each skin is a particular directory, for example skins/default/ for the default skin.

Here is the list of required template files: Each template include a CSS file, named "styles.css".

To create your own skin, just copy the default skin to another directory (eg.: skins/myskin/) and edit templates and CSS files. Advanced customization can be done by editing the portal/index.pl.

Templates variables provided by portal/index.pl

When you edit/create a template file, you can use some variables provided by the portal script. Of course, you can add variables by editing the portal/index.pl.

Common variables

login.tpl specific variables

menu.tpl specific variables

Template structure

The default LemonLDAP::NG template follow this structure:

Internationalization (i18n)

LemonLDAP::NG portal is able to display an HTML template according to the user's browser language.

In order to work, you have to set inside the template the translations of all displayed text. Error message translation is already done inside LemonLDAP::NG Portal module.

Example of mono-lingual template

<p><label>Login</label>
<input name="user" type="text" size="30" />
</p>

The string "Login" is set in the template and will not be translated.

Example of multi-lingual template

<p><label><lang en="Login" fr="Identifiant" /></label>
<input name="user" type="text" size="30" />
</p>

The markup <lang> will be catched by LemonLDAP::NG and only the wanted translation will be displayed. If the user's language has no corresponding translation, the first translation is selected. So you can set your default language by choosing the first translation ("en" in the above example).

Warning: don't forget the quotes and the trailing slash of the markup!