+

Search Tips   |   Advanced Search

Skin templates


The static skin template skin.html is located in the root directory of the skin folder of the WebDAV file store. The skin.html file provides the full markup for decoration around a portlet or iWidget. As with theme templates, we can use dynamic content spots to add dynamic elements to the skin template at run time.

The portal provides a base skin template and localized skin templates.

The skin.html file is located in the root directory of the skin on WebDAV \fs-type1\skins\skin-name\, and there are localized skin.html files located within the nls directory under the skin \fs-type1\skins\skin-name\nls\. Modify the skin template files using the WebDAV entry point fs-type1. When we use this entry point, the changes to the skin template are immediately reflected with a browser refresh.


Root skin template

In a default WebSphere Portal installation, the portal does not render the template file skin.html located in the root directory of the theme. Instead, this file links to the localized templates, and the portal renders the appropriate localized template. The links to the localized templates are at the beginning of the root template. They have the following form:

<a rel="alternate" href="http://setgetweb.com/p/portal80/nls/skin_locale_code.html" hreflang="locale_code" class="wpthemeDisplayNone"></a>

An example of a link to the English template file is as follows:

<a rel="alternate" href="http://setgetweb.com/p/portal80/nls/skin_en.html" hreflang="en" class="wpthemeDisplayNone"></a>
You can place the wpthemeDisplayNone class on these links so that the browser does not expose the anchor element in the user interface. This class makes sure that accessible technologies, such as screen readers, do not encounter these links in the tab order.

If you do not want to use localized skin templates, we can remove these links from the beginning section of the skin.html template in the root directory. If we remove the links, the portal renders the root template.

The root skin template also includes Apache Ant scripting in the following form:

${bundle_name:bundle_key:character_encoding}

The character_encoding replaces special characters with the escape sequence determined by the specified encoding. The available types of encoding are XML or JSON. We can chain multiple instances of encoding by or as follows:

${bundle:key:json:xml} or ${bundle:key:xml:json}

We can use the Apache Ant build framework to generate localized templates based on this root template. This framework can be useful to update one template during development and then generate the templates. To use only the root template, replace the Ant scripting with the preferred text to be rendered. We can learn more about the Ant build tool at the Apache Ant Welcome page.


Localized skin templates

In a default portal installation, the theme renders content using the localized skin templates. These templates are located in the nls subdirectory under the skin directory on WebDAV. These files have the locale code appended to the end of the template name, for example skin_en.html for English. These templates have translated static text inline within the template.

When we use the localized skin templates and want to view the changes, update the templato that the portal renders in the browser.

For example, if the preferred language is English, update the fileskin_en.html file.


Server-side dynamic content spots


Client-side dynamic content spots

Client-side content spots are replaced at page load time or at run time through JavaScript by RuntimeSkinModel and the live text service.


Parent: Skins
Related:

Apache Ant Welcome page