+

Search Tips   |   Advanced Search

Create a placeholder tag

We use a placeholder tag to display metadata within an element or component design.

The format of a placeholder tag:

    [placeholder tag=" " htmlencode=" " start=" " end=" " ]

To create a placeholder tag:

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

  2. Select Placeholder as the tag type.

  3. Select a placeholder tag type.

    This is added to the placeholder tag as the tag=" " parameter:

      Tag type Description
      Name Display the name of the site area or content being retrieved in a menu or navigator. This can also be used when creating a user name component, where we can add a placeholder tag in the design and specify tag="name" to render the name of the user.
      Title Display the title of the site area or content being retrieved in a menu or navigator.
      dn Used when creating a user name component. We can add a placeholder tag in the design and specify tag="dn" to render the distinguished name of the user.
      HREF Insert a link to the page of the site area or content being retrieved in a menu or navigator.
      noprefixhref The URLs generated by "HREF" parameter is fully qualified when viewed through a portal. To generate URLs with no prefix, use the "noprefixhref" parameter instead of the "HREF" parameter.
      namelink Combination of the name and HREF tags. Assembles a complete link based on the name of the item being returned.
      noprefixnameLink The URLs generated by "nameLink" parameter is fully qualified when viewed through a portal. To generate URLs with no prefix, use the "noprefixnameLink" parameter instead of the "nameLink" parameter.
      TitleLink Combination of the title and HREF tags. Assembles a complete link based on the title of the item being returned.
      noprefixtitleLink The URLs generated by "titleLink" parameter is fully qualified when viewed through a portal. To generate URLs with no prefix, use the "noprefixtitleLink" parameter instead of the "titleLink" parameter.
      sitepath Similar to the HREF placeholder except that it only display the site path of an item's URL. For example, an HREF placeholder tag displaying a content item may give you:

      • /wcm/connect/metaorg/intranet/press+releases

      Whereas the site path will give you:

      • /metaorg/intranet/press+releases

      For example, an HREF placeholder tag displaying a site area may give you:

      • /wcm/connect/metaorg/intranet/

      Whereas the site path will give you:

      • /metaorg/intranet

      Note the final / slash is not included when the site path is displayed for site areas.

      Idnum This returns the hexadecimal ID value of an item. This can be used when creating static URLs in menus and navigators. You could hard-code the site area path in a menu or navigator element design and use the Idnum for each content item being displayed. This would allow us to display content with a different presentation template (for example, a printer friendly presentation template) or use different security settings.
      Listnum Displays a single column list of numbered links:

      1. First

      2. Second

      3. Third
      Treenum Displays a hierarchical numbered list:

      1.0
      1.1
      1.2
      2.0
      2.1
      2.2

      Paddedtreenum Similar to Treenum, but the numbers are padded:

      0001
      00010001
      00010002
      000100020001
      000100020002

      Depth Displays the depth of the currently processed node (in a navigator or menu) as a number. A top-level node has a depth of 1.

  4. If we are using the placeholder tag with an authoring tools element rendered by the JSR 286 web content viewer, specify the format attribute to control where the authoring task is performed.

      format="tag" The placeholder is rendered as a URL that opens a pop-up window containing the authoring portlet. Default value if no value is specified.
      format="url" The placeholder is rendered as a URL that redirects the user to a hidden portal page used by the JSR 286 web content viewer for inline editing.

  5. Select the type of encoding for the placeholder:

      Encode tag output The reserved HTML characters in the source is converted into character entities. For example, '<' is converted to '&lt;'. This is useful if to prevent users adding malicious code, or to prevent users changing the look and feel of their text using HTML.
      Do not encode tag output If selected, no encoding is applied to the HTML rendered by the placeholder tag.
      Default encoding If selected the default setting specified by the cmpnt.htmlEncodeDefault property in the WCM WCMConfigService service is used. By default, this property is set to true.

  6. Click OK to add the tag to your design.


What to do next

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

Tag parameters Details
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.

Use a URLCmpnt tag:

The URLCmpnt tag is used to generate a URL to a site area or content item and can be used as an alternative to a placeholder when generating a URL. This is particularly useful when creating links to web content displayed within rendering portlets.


Parent Create web content tags