Skin layout templates (skin.html)

The portal provides a base skin template and localized skin templates. The static skin template is named skin.html .

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/ . The skin.html provides the full markup for decoration around a portlet or iWidget. Just as with theme templates, you can use dynamic content spots to add dynamic elements to the skin template at runtime.
Notes:


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 top of the root template. They have the following form:

<a rel="alternate" href="nls/skin_locale_code.html" hreflang="locale_code" class="ibmHideTemplate"></a>

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

<a rel="alternate" href="nls/skin_en.html" hreflang="en" class="ibmHideTemplate"></a>

You can place the class ibmHideTemplate 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 tabbing order.

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

This 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 . You can chain multiple instances of encoding by or as follows:

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

You can use the Apache ANT build framework to generate localized templates based on this root template. This can be useful if you want to update one template during development and then generate the localized templates by using the ANT build process. To use only the root template, replace the ANT scripting with the preferred text that you want to be rendered. You can learn more about the ANT build tool here at the web link to the Apache Ant Welcome page given below.


Localized skin templates

In a default WebSphere Portal installation, Page Builder renders content by 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 you use the localized skin templates and want to view changes, update the template that the portal renders in the browser. For example, if preferred language is English, update the fileskin_en.html .


Server-side dynamic content spots


<a rel="dynamic-content" href="lm:title">


<a rel="dynamic-content" href="lm:control">


Client-side dynamic content spots

Client-side content spots are replaced at page load time or at runtime via JavaScript by the RuntimeSkinModel and live text service.
class='lm-dynamic-icon'


class='lm-dynamic-title'


Skin decorator

You can use the skin decorator to inject dynamic JavaScript into the template. A common use case for the decorator is to be able to name space elements with the control ID. In the skin template for a layout control, you can include a marker that contains the resource name of the decorator module. The portal creates an instance of the decorator at the root DOM node for each layout control for which such a marker is included in the skin template. The portal passes the ID of the layout control and the root DOM in the constructor to the decorator.
Example of a decorator definition:


Example of decoration:


Examples of adding dynamic JavaScript to template elements:


Parent

Elements of a theme


Related tasks

http://ant.apache.org/

  typos, grammar, exposed <> names that were hidden


+

Search Tips   |   Advanced Search