Template Customizations
The following customizations are made to main_template:
- calling vsAnonCheck - a feature which sends user to login form if www. protocol not used.
- portlet headings and page titles have same colour as currently selected navbar tab
- enabling different customizations for .my and .www sites
Of course, main_template is also customized to provide the new slots.
Other global templates that are customized include:
- global_sections: providing up to 7 new global navbar tabs
- global_pathbar: changing the breadcrumbs slightly
Also, vsCore gives the following possible page template customization:
- call vsRandom: add random document or image to page.
main_template customisations:
calling vsAnonCheck
vsAnonCheck checks automatically if the browsed URL contains the token "www". If this is not the case and the user is not logged in yet, he/she will be redirected to the login_form.
If, however, a my. URL is entered which is not equal to the URL of the Plone Site Root, then the user will be redirected to the equivalent URL with my.replaced by www.
To enable vsAnonCheck, the main_template must be customized as follows:
<body tal:attributes="class here/getSectionFromURL">
<!-- ### start VSA add-ins ### -->
<tal:vsa tal:define="x python:here.vsAnonCheck(isAnon)" />
<!-- ### end VSA add-ins ### -->
<div id="visual-portal-wrapper">
vsCore adds this customization automatically.
main_template body div:
Ensures that portlet headings and page titles will have the same colour as the currently selected global navbar tab. Everything underneath the body tag is enclosed by a div tag having an id corresponding to the selected tab;
for example id="vs-scheme1" or id="vs-scheme2" etc.
If no global navbar tab is selected, the id will be "vs-scheme1".
This customization is currently not working with the “sub-sites” feature.
main_template add-in body_end_code_www / body_end_code_my:
Sometimes users might need to insert different customizations for
the “www” and “my” sites: one example might be so that stats software
can differentiate between anonymous and authenticated users.
vsCore creates separate page templates "body_end_code_www" (for
anonymous users) and "body_end_code_my" (for "my."-URLs) which allow
users to insert code directly before the body-end-tag of the main_template.
To use this feature, go to portal_skins/vsCore, click on body_end_code_www
or body_end_code_my as required, and then on Customize.
Now customize the templates as required.
Other global template customizations:
global_sections
vsCore allows for up to seven top navbar tabs.
The global navbar tabs are list items with classes c-1, c-2, ..., c-7, etc.
global_pathbar
Breadcrumbs customization: Doesn't show "you are here" anymore; and doesn't show the portal itself. The breadcrumbs start with public_home – so this folder should be given a meaningful title!
Adding vsRandom to page template:
vsRandom(ATDocument) renders a randomly selected document from the current "documents" folder. It is mainly used for portlet_vsrandomdocument, but can also be called from a page template, using
<span tal:replace="structure python:here.vsRandom('ATDocument')" />
vsRandom(ATImage) renders a randomly selected Image from the current "pictures" folder. It is mainly used for portlet_vsrandomimage, but can also be called from a page template, using
<span tal:replace="structure python:here.vsRandom('ATImage')" />
