+

Search Tips   |   Advanced Search

Create a plug-in tag

Render plug-ins are referenced using the plug-in tag. Select from preinstalled rendering plug-ins, or select our own custom plug-ins.

The following is the format of a plug-in tag:

[plugin:pluginname paramKey="paramVal" compute=" " htmlencode=" " start=" " end=" "]
Tag Body Content [/plugin:pluginname]

To create a plug-in tag:

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

  2. Select Plugin Component as the tag type.

  3. Select a plug-in type.

  4. Select the plug-in to reference. Information about the plug-in, and valid parameters, are displayed.

  5. Select whether to include start and end sections. We can enter additional text between the start and end sections of the tag including other web content tags such as a component or element tag.

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

  7. We can then add custom parameters to the tag design. After adding the tag to the design, we can also add the following parameters to the tag:

    Tag parameters Details
    compute=" " When we reference a plug-in in menu or navigator designs, we use a tag with a parameter of compute="always".
    htmlencode=" " If htmlencode="true" reserved HTML characters are converted into character entities. For example, '<' is converted to '&lt;'. This parameter is useful if to prevent users from adding malicious code, or to prevent users from 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.


Examples

    Simple tag

    To reference a plug-in without specifying any parameters or tag body content:

      [plugin:pluginname]

    Simple tag with parameters

    To reference a plug-in with parameters but no tag body content:

      [plugin:pluginname paramKey1="paramVal" paramKey2="paramVal" paramKey2="paramVal2"]

    Plug-in tag with web content tag as a parameter

      [plugin:pluginname paramKey1="[IDCmpnt context='current' type='sitearea' field='id']"]

    Use single quotation marks within the web content tag being used as a parameter value.

    Plug-in tag with body content

    To reference a plug-in with parameters and content including a reference to a component:

    [plugin:pluginname paramKey1="paramVal" paramKey2="paramVal" paramKey2="paramVal2"]
    The tag body content.
    <br>
    [component name="test"]
    <br>
    More content.
    [/plugin:pluginname]

    If Device and If Not Device plug-ins
    Use the If Device and If Not Device plug-ins to render content selectively, based on a user's Portal device class. Use these plug-ins for switching to mobile components, such as a slideshow or carousel that are optimized for mobile devices, when a user goes to the site through a smartphone or tablet.

    The class attribute is defined by the device classifications for supported clients in IBM WebSphere Portal. Log in to WebSphere Portal as an administrator and click the Administration menu icon in the toolbar. Then, click Portal settings > Supported clients. Edit a selected client to see the classes that are already associated with it. We can add or remove classes through this page.

    We can check that a specific device is in use with the following format:

    [Plugin:ifDevice class="DEVICE1" class="DEVICE2"]
    Text to render if current device is DEVICE1 or DEVICE2.
    [/Plugin:ifDevice]

    We can check that a specific device is not in use with the following format:

    [Plugin:ifNotDevice class="DEVICE1" class="DEVICE2"]
    Text to render if current device is not DEVICE1 or DEVICE2.
    [/Plugin:ifDevice]

    This is used to render text if no device is set:

    [Plugin:ifDevice class=""]
    Text to render if the device is not set.
    [/Plugin:ifDevice]


Parent Create web content tags

Related concepts:

Use remote action plugins