Skip to content

Placeholder tag

Use the placeholder tag to display metadata within an element or component design.

See the format of a placeholder tag:

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

Creating a Placeholder tag

To create a placeholder tag:

  1. Click Insert a Tag from a presentation template 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 Placeholder tag="" parameter:

    • Name

      Syntax: [Placeholder tag="name"]

      Use this tag to display the name of the site area or content item that is retrieved in a menu or navigator. You can also use this parameter when you create a user name component, where you add a name placeholder tag in the design to render the name of the user.

    • Title

      Syntax: [Placeholder tag="title"]

      Use this tag to display the title of the site area or content item that is retrieved in a menu or navigator.

    • Distinguished Name

      Syntax: [Placeholder tag="dn"]

      Use this tag when you create a User Name component. Add a dn placeholder tag in the design to render the distinguished name of the user.

    • URL

      Syntax: [Placeholder tag="HREF"]

      Use this tag to insert a link to the page of the site area or content item that is retrieved in a menu or navigator.

    • No Prefix URL

      Syntax: [Placeholder tag="noprefixhref"]

      The URLs generated by the HREF parameter is fully qualified when viewed through a portal. Use this tag to generate URLs with no prefixes.

    • Name Link

      Syntax: [Placeholder tag="nameLink"]

      This tag is a combination of the name and HREF tags. Use this tag to assemble a complete link based on the name of the item that is returned.

    • No Prefix Name Link

      Syntax: [Placeholder tag="noprefixnameLink"]

      The URLs generated by nameLink parameter is fully qualified when viewed through a portal. Use this tag to generate URLs with no prefixes.

    • Title Link

      Syntax: [Placeholder tag="titleLink"]

      This tag is a combination of the title and HREF tags. It assembles a complete link based on the title of the item that is returned.

    • No Prefix Title Link

      Syntax: [Placeholder tag="noprefixtitleLink"]

      The URLs generated by titleLink parameter is fully qualified when viewed through a portal. Use this tag to generate URLs with no prefixes.

    • Site Area Path

      Syntax: [Placeholder tag="sitepath"]

      Use this tag to only display the site path of an item's URL. For example:

      • An HREF placeholder tag that displays a content item might give you:

        /ILWWCM/connect/metaorg/intranet/press+releases
        

        Whereas the site path gives you:

        /metaorg/intranet/press+releases
        
      • An HREF placeholder tag that displays a site area might give you:

        /ILWWCM/connect/metaorg/intranet/
        

        Whereas the site path gives you:

        /metaorg/intranet
        

        Note

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

    • ID

      Syntax: [Placeholder tag="Idnum"]

      This tag returns the hexadecimal ID value of an item. Use this tag to create static URLs in menus and navigators. You can hardcode the site area path in a menu or navigator element design and use the Idnum for each content item displayed. This method is used to display content with a different presentation template (for example, a printer-ready presentation template) or use different security settings.

    • List Number

      Syntax: [Placeholder tag="Listnum"]

      Use this tag to display the index of the item in the list.

    • Tree Number

      Syntax: [Placeholder tag="Treenum"]

      Use this tag to display a hierarchical numbered list:

      1.0
      1.1
      1.2
      2.0
      2.1
      2.2

    • Padded Tree Number

      Syntax: [Placeholder tag="Paddedtreenum"]

      Use this tag to display a hierarchical numbered list, similar to Treenum, but the numbers are padded:

      0001
      00010001
      00010002
      000100020001
      000100020002

    • Depth

      Syntax: [Placeholder tag="depth"]

      Use this tag to display the depth of the currently processed node (in a navigator or menu) as a number. A top-level node has a depth of 1.

    • Value

      Syntax: [Placeholder tag="value"]

      Use this tag to print information about the current item.

      For example: ControllableNodeValue(Sample Article 2, {ce95ce18-bf08-492f-98b9-4ffc6c6f158a, com.aptrix.pluto.content.Content})

  4. If you are using the placeholder tag with an authoring tools element that is 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 the authoring portlet in a new window. This behavior is used by default if no value is specified.

    • format="url"

      The placeholder is rendered as a URL that redirects the user to a hidden portal page that is used by the JSR 286 web content viewer for inline editing.

  5. Select the type of encoding for the placeholder:

    • Encode tag output

      If selected, the reserved HTML characters in the source are converted into character entities. For example, < is converted to &lt;. This method is useful if you would like to prevent users from adding malicious code, or if you want to prevent users from changing the look and feel of their text with 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 navigator design.

Once you add the tag to your design, you 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 that is returned by a tag within other tags, such as HTML. These attributes are not mandatory.

URL Component tag

The URL Component (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 a URL is generated. This method is useful when you create links to web content displayed within rendering portlets. Refer to the URL Component tag page for more information.

HCLSoftware U learning materials

To learn more details on how to develop with HCL Digital Experience (DX) Web Content, go to the Web Content Development lesson in the HCL Digital Experience for Developers (Intermediate) course. You can try it out using the Web Content Development Lab and corresponding Web Content Development Lab Resources.