LemonLDAP::NG is shipped with 4 skins:
bootstrap
skin, as other may be deprecated in the future.
But you can make your own, see Skin customization below.
You can change the default skin in Manager: General Parameters
> Portal
> Customization
> Default skin
.
Select the Custom
skin, then set the name of the skin you want to use in the input below.
Go in General Parameters
> Portal
> Customization
> Skin background
. You can define a background by selecting one of the available image. Use None
to use the default skin background configuration.
You might want to display different skin depending on the URL that was called before being redirected to the portal, or the IP address of the user.
To achieve this, you can create a rule in the Manager: select General Parameters
> Portal
> Customization
> Skin display rules
on click on “New key”. Then fill the two fields;
A skin is composed of different files:
A skin will often refer to the common
skin, which is not a real skin, but shared skin objects (like scripts, images and CSS).
Here we explain how to create a new skin, named myskin
, from the bootstrap
skin.
cd /usr/share/lemonldap-ng/portal-skins/ mkdir myskin cd myskin/ cp -a ../bootstrap/fonts/ . cp -a ../bootstrap/js/ . cp -a ../bootstrap/css/ . mkdir images
Then create symbolic links on template files, as you might not want to rewrite all HTML code (else, do as you want).
ln -s ../bootstrap/*.tpl .
We include some template files that can be customized:
To use custom files, delete links and copy them into your skin folder:
rm -f custom* cp ../bootstrap/custom* .
Create a symlink in main skin directory:
ln -s /usr/share/lemonldap-ng/portal-skins/myskin /var/lib/lemonldap-ng/portal/skins/
Then you only have to edit JS/CSS and add your media to myskin/images
. Put all custom HTML code in the custom template files.
To configure your new skin in Manager, select the custom skin, and enter your skin name in the configuration field.
Messages are defined in source code. If they really do not please you, override them! You just need to know the ID of the message (look at Portal/Simple.pm) and then add to lemonldap-ng.ini
:
[portal] # Custom error messages error_0 = Big brother is watching you, authenticated user # Custom standard messages msg_22 = Your last connections
[portal] error_en_0 = Big brother is watching you, authenticated user error_fr_0 = Souriez vous êtes surveillés !
Template parameters are defined in source code. If you need to add a template parameter for your customization, then add to lemonldap-ng.ini
:
[portal] # Custom template parameters tpl_myparam = world
Then you will be able to use it in your template like this:
Hello <TMPL_VAR NAME="myparam">!
This node allows one to enable/disable buttons on the login page:
Connected as
in the menu