+

Search Tips   |   Advanced Search

Use style sheets in items

Style sheets can be used to format the look and feel of Web Content Manager pages in the same way as normal web pages.


Create and referencing style sheet elements

Style sheet elements can only be stored in style sheet components.

To link a style sheet component to a specific authoring template, select a style sheet component as the default style sheet in an authoring template.

To link a style sheet component to a specific site area or content item, add a component reference element to a site area or content item and select a style sheet component.


Referencing a style sheet element in a presentation template

Style sheet elements are referenced in the "header" section of a presentation template using either a style element tag or component tag.

Details Code example

To use the style sheet specified in the authoring template of the current content item, use a <styleElement> tag.

<HTML>
<HEAD>
<styleElement source="template"/>
</HEAD>
<BODY></BODY>
</HTML>

To use the style sheet selected in a component reference element stored in either the current site area or content item, use a <styleElement> tag.

<HTML>
<HEAD>
<styleElement source="path" name="component 
reference name"/>
</HEAD>
<BODY></BODY>
</HTML>

To use a specific style sheet, use a <component> tag.

<HTML>
<HEAD>
<component name="style sheet 
component name"/>
</HEAD>
<BODY></BODY>
</HTML>

When rendered in web content, references to style sheet components are rendered as external style sheet links:

<HTML>
<HEAD>
<link href="stylesheet" media="media-type" rel="styleheet-type" type="text">
</HEAD>
<BODY></BODY>
</HTML>


Use styles in HTML tags

Styles are used in HTML stored in presentation templates and element designs in the same way as normal HTML. The style must exist in the style sheet that has been referenced in the presentation template used to render the HTML.

For example, to add a class called "wcm" to a heading tag:

<H1 class="wcm">Heading</H1>


Using styles in web content tags

Style sheets can be used to format the style of content retrieved using Web Content Manager tags. The style must exist in the style sheet referenced in the presentation template used to render the Web Content Manager tag.

For example, to format the links in a menu using a style sheet class called "wcm", the following placeholder tag would be used:

<a href="<placeholder tag="href" />" class="wcm"><placeholder tag="name" /></a>


Parent: Storing files and images