Inline tag widget parameter reference
You configure inline tag widget instances by setting the following Javascript parameters.
Mandatary parameters
The following parameters are mandatary for the tag widget.
- id = unique_ID
- Use this attribute to specify a unique ID for parsing all surrounding <div> tags to enable the widgets
- resourceID
- Specify the identifier of the piece of content that will show the widget. This needs to be unique.
For example, for a portal page specify the portal object ID on that page.
- resourceTitle
- Title of the piece of content. This title string is passed to the dialog box when the user opens it to add new tags. If you do not want the dialog box to show a title, we can omit the value for this parameter.
- resourceType = NAVIGATION_NODE | CONTENT_NODE
- Type of the resource for which the rating widget is called. This parameter is mandatary only for portal resources such as pages or portlets. Valid values are NAVIGATION_NODE or CONTENT_NODE .
Optional parameters
The following parameters are optional for the tag widget. They correspond to similar parameters in the CP Configuration Service.
- countsEnabled = false
- Whether the count of each community tag is displayed. The count shows how often the tag has been applied by users. Default is false. To have the count of each community tag displayed, specify true . The count is then displayed in parentheses.
- customLabel
- Non-localized custom label to describe the displayed tags. If you do not want any further labelling or to keep the label short, this can be an empty string.
- customMessageNoTags
- Non-localized custom label to display if no tags are available. This can happen when users have not assigned tags to the piece of content yet. Non-localized means that the label does not change with the browser language. This parameter has no default value.
- displayTwisty = (COLLAPSED)
- Behavior of twisty displayed as part of the inline tag widget. Valid values are COLLAPSED|EXPANDED|HIDDEN :
- COLLAPSED
- The twisty is displayed but closed. Default.
- EXPANDED
- Both the twisty and the widget are shown.
- HIDDEN
- The twisty is not displayed. The widget is open and cannot be closed.
- tagScope = (COMMUNITY_PERSONAL_PUBLIC)
- Scope of tags to show in this inline widget. Specify one of the following values:
ALL|COMMUNITY|PERSONAL|PERSONAL_PUBLIC|PERSONAL_PRIVATE|COMMUNITY_PERSONAL_PUBLICIf you do not specify a value, the parameter defaults to COMMUNITY_PERSONAL_PUBLIC .
- resourceCategories = ["resrc_category_1", "resrc_category_2", . . . "resrc_category_n"]
- Array of categories assigned to the resource for which the widget was called. Represent each category by a string, for example Books or a Web Content Manager category. A typical value is ["books", "action"] .
- resourceType
- Use this parameter to specify the portal resource type. This can be either CONTENT_NODE or NAVIGATION_NODE . Specifying this parameter is mandatary for portal resources only.
- resourcePrivate = true|false
- We can set this parameter to avoid access control issues with private resources. Users can only add private tags to private resources. The default value is false .
- maxResults = 5
- Number of tags shown per resource. The default value is 5 .
- order = DESC|ASC
- Order direction for displaying the tags. Related to the parameter orderMetric . It can take the following values:
- DESC
- Default. Specifies descending order.
For example, when the default TAG_SPACE_COUNT_REVERSE_NAME is specified for the previous order metric parameter, tags with the highest count and the lowest character in the alphabet are listed first.
- ASC
- Specifies ascending order.
For example, if the order metric parameter is specified as...
orderMetric = TAG_SPACE_COUNT
...tags with the lowest count are listed first.
- orderMetric = TAG_SPACE_COUNT_REVERSE_NAME
- Order metric for the order by which the tags are displayed. To determine the actual order, use the parameter order Default is TAG_SPACE_COUNT_REVERSE_NAME . Tags are shown first by the tag count, with resources with more tags shown before resources with fewer tags, then, if resources have the same number of tags, alphabetically. Other possible values are:
- TAG_SPACE_NAME
- TAG_SPACE_COUNT
- TAG_SPACE_CREATION_DATE
- TAG_SPACE_LAST_MODIFIED_DATE
- TAG_SPACE_COUNT_NAME
For more details refer to the class com.ibm.portal.cp.Constants.OrderMetric in the portal Javadoc.
- tagClickActionMode = TAG_CENTER|PUBLIC_RENDER_PARAMETER
- Determine what happens when a user clicks a tag. Valid values are:
- TAG_CENTER
- The widget redirects the user to the tag center. Default.
- PUBLIC_RENDER_PARAMETER
- The widget exposes a public render parameter with the tag name.
- showDialogLauncher = true|false
- Control whether a plus ( + ) button for starting the corresponding dialog widget is shown. The default is true .
- tagDialogWidgetParameters
- Specify a JSON object containing optional configuration parameters for the tag dialog widget instance that opens when a user clicks the plus sign in the inline widget. For a list of possible parameters refer to the topic about the Tag dialog widget parameter reference. The mandatary parameters that were already specified for the inline widget are applied to the dialog widget instance that starts. These are resourceID , resourceTitle , resourceType , resourceCategories .
For example, we cannot override the resourceID by specifying a different one in this object here.
- tagsChangedEvent = (tagsChanged)
- Event that informs the inline widget about changes to the tags for the resource. This allows the inline widget to update the tag set, for example if a user adds a tag in the dialog widgetDefault is tagsChanged. The event name specified here must match the event name specified for the tag dialog widget.
- tagsClickable = true|false
- Whether the tags can be clicked for redirection or public render parameter exposure. The default is true .
- tagClickTransmitScopes = (false)
- Whether scopes to which a tag belongs, for example categories, are transmitted, when a user clicks a tag. Setting true makes sense only if you also set...
com.ibm.wps.cp.tagging.inline.tagsClickable = true
Parent: Parameter reference for the tag and rating widgets
Related reference:
Tag dialog widget parameter reference
CP Configuration Service for tagging and rating