Create a URL tag

The URLCmpnt tag is used to generate a URL to a site area or content item.

This is the format of a URLCmpnt tag:

 [URLCmpnt mode=" " context=" " type=" " name=" " pageDesign=" " portalTarget" " usedIn=" " start=" " end=" " htmlencode=" "]

To create a URLCmpnt tag:

  1. Click Insert a Tag from a presentation template or element design field. The Tag Helper dialog opens.

  2. Select URL as the tag type.

  3. Select a mode type. This determines the type of URL that is generated. This is added to the tag as the mode=" " parameter:

      portal

      standAlone

      current

        This generates a URL based on the format of the current request. For example, if the current request is a WebSphere Portal request, then mode="portal" is used.

  4. Select a source item type. This is added to the tag as the type=" " parameter:

      Content

        Use this option to display the URL of the current content item.

      Parent

        Use this option to display the URL of the parent site area of the current content item

      Top

        Use this option to display the URL of the top site area in the current path of the current content item.

  5. Select the context of the item to retrieve the URL from. This is added to the tag as the context=" " parameter:

      Selected

        Select a specific site area or content item. You must then add the name of the item being referenced using the name=" " parameter. You can select an item by clicking Select.

      Current

        Use this option to retrieve the URL from the current site area or content item.

      AutoFill

        Use this option when the URL being retrieved is determined by the search parameters of a menu, navigator, or taxonomy component. If the tag is not used within a menu, navigator, or taxonomy component, the context will revert to the current item.

      1. If you select Selected, click the Select button to select a specific site area or content item.

      2. If you select Current or Autofill, click Select authoring template to select an appropriate authoring template.

  6. To render the content using an alternative presentation templates, click presentation template. This is added to the tag as the pageDesign=" " parameter.

  7. Select Portal Page Target if you want to render the content on a specific Portal page. You can enter the compound name of the URL mapping or friendly URL of the target portal page in the tag after you add the tag to design. This can only be used if mode="current" or mode="portal". This is added to the tag as the portalTarget=" " parameter.

  8. Click OK to add the tag to design.

Once you have added the tag to design, you can also add the following parameters to the tag:

Table 1. Additional tag parameters

Tag parameters Details
name=" " If you specify name="./itemName", the actual path is not resolved until the item is rendered. This takes slightly longer to resolve than specifying the path to the item.
usedIn=" " To use the URL in JavaScript, add the parameter usedIn="script" to the tag.
htmlencode=" " If htmlencode="true" the reserved HTML characters in text, short text and option selection elements are converted into character entities. For example, '<' is 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 by the cmpnt.htmlEncodeDefault property in the WCM WCMConfigService service is used. By default, this property is set to true.

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.


Create web content tags

December 14, 2011
   

 

Apr 1, 2011 1:26:17 PM

});


+

Search Tips   |   Advanced Search