+

Search Tips   |   Advanced Search


Referencing a Federated content element

The federated content element tag is used to reference a federated content element within a presentation template or element design.

<FederatedCmpnt type=" " context=" " name=" " key=" " scope=" " attributename=" " format=" " htmlencode=" " awareness=" " start=" " end=" " />
<FederatedCmpnt Opens the tag.
type=" " This determines where the element is being referenced from. Either "content", "sitearea" or "site".
context=" " This determines which item is being referenced.

Selected

Refers to a particular item as specified in the name attribute below.

Current

This will reference the element from the current site, site area or content file that is being browsed by the user.

AutoFill

The element being referenced will be determined by the search parameters of a menu, navigator or taxonomy component.
name=" " Enter the name and library of the item the element is being referenced from.

For example, name="library/item".

To use the library specified in the URL of the current page, use name="./item".

  • If a content item with the same name is used in more than one site, you can also specify name="library/site/sitearea/item" to select the appropriate content item.

  • If you specify name="./item", the library name will not appear in your presentation template or element design. The actual path will not be resolved until the item is rendered.

The "name" parameter is not used if context=current or context=autofill.

key=" " This is the name of the element being referenced.
scope=" " The scope specifies what will be returned from the selected federated content:

content

This will display the content of the federated content.

contenturl

This will display the URL to the federated content.

attribute

This will display a particular attribute of the federated content.
attributename=" " If scope="attribute" use this parameter to specify the attribute to display.
format=" "

When referencing number or date elements:

In this case, the format is used to specify the display format of dates and numbers. The following formats can be defined when displaying dates:

  • format="DATE_SHORT"

  • format="DATE_MEDIUM"

  • format="DATE_LONG"

  • format="DATE_FULL"

  • format="DATE_TIME_SHORT"

  • format="DATE_TIME_MEDIUM"

  • format="DATE_TIME_LONG"

  • format="DATE_TIME_FULL"

  • format="TIME_SHORT"

  • format="TIME_MEDIUM"

  • format="TIME_LONG"

  • format="TIME_FULL"

  • format="relative" (The relative date will be displayed as either "today", "yesterday" or the number of days ago.)

You can also set user-defined formats for both dates and numbers.

When referencing user details:

When formatting user details, the format parameter is used to define which LDAP parameter to use when displaying user details.

For example:

  • format="cn" is used to display the common name.

  • format="dn" is used to display the distinguished name.

Maximum character length:

You can also specify a maximum number of characters to display by using this format:

  • format="length:number_of_characters"

For example, to display a maximum of ten characters you would specify the following parameter:

  • format="length:10"

htmlencode=" " If htmlencode="true" the reserved HTML characters in the federated content will be converted into character entities.

For example, '<' will be converted to '&lt;'. This is useful if you would like to prevent users adding malicious code, or if you want to prevent users changing the look and feel of their text using HTML. If not specified, the default setting specified in WCMConfigService.properties located in the PROFILE_HOME/PortalServer/wcm/config/ directory is used. By default, this is set to "true":

cmpnt.htmlEncodeDefault=true
awareness=" " If awareness="true" then user names are displayed using the people awareness features. These features displays user names as hyperlinks that allow users to contact people with whom they might want to work. Wherever person links appear, users can click the link to display a menu of actions for collaborating (contacting and working) with the person named by the link.

If you, as administrator, have also configured an IBM Lotus Sametime server to work with WebSphere Portal, person links indicate whether a person is active, away, offline, or in a Do Not Disturb state.

People awareness will only work in content rendered using either a local or remote rendering portlet.

If not specified, then awareness="false" and people awareness is not used.

start=" "

end=" "

The start and end attributes are used to wrap the data returned by a tag within other tags, such as HTML. These attributes are not mandatory.
/> This closes the tag.

When using this tag, only required parameters should be used. Do not include parameters that are not required, or that contain no settings.


Examples:

Display the attributes of federated content:

To display the "title" of federated content, the following tag could be used:

<FederatedCmpnt type="content" context="current" key="elementname"  scope="Attribute" attributeName="title" />

To display the "last modified" date of federated content the following tag could be used:

<FederatedCmpnt type="content" context="current" key="elementname"  scope="Attribute" attributeName="lastModified" format="dd/MM/yyyy" />

Display the content of federated content:

Only federated content of the type "text/*" can be rendered as content. To display the content of federated content, the following tag could be used:

<FederatedCmpnt type="content" context="current" key="elementname"  scope="content" />

Display the URL of federated content:

To display the URL of federated content, the following tag could be used:

<FederatedCmpnt type="content" context="current" key="elementname"  scope="contenturl" />

Display the URL of federated content as a link:

To display the URL of federated content as a link in a Web page, the following tags could be used:

<a href="
<FederatedCmpnt type="content" context="current" key="elementname"  scope="contenturl" />
">
<FederatedCmpnt type="content" context="current" key="elementname"
 scope="Attribute" attributeName="title" />
</a>

Display an image stored as federated content:

To display an image stored as federated content, the following tags could be used:

<img src="<FederatedCmpnt type="content" context="current" key="elementname"  scope="contenturl"/>" >


Parent topic:

Creating Web content tags