Inline rating widget parameter reference
You configure inline rating widget instances by setting the following Javascript parameters.
Mandatory parameters
The following parameters are mandatory for the rating widget.
id = unique_IDUse this attribute to specify a unique ID for parsing all surrounding <div> tags to enable widgets
resourceIDUse this parameter to 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 of that page.
resourceTitleUse this parameter to specify the title of piece of content. This title string is passed to the dialog box when the user opens it to add a rating. If you do not want the dialog box to show a title, you can omit the value for this parameter.
resourceType = NAVIGATION_NODE | CONTENT_NODEUse this parameter to specify the type of the resource for which the rating widget is called. This parameter is mandatory 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 rating widget. They correspond to similar parameters in the CP Configuration Service.
customLabelUse this parameter to specify a non-localized custom label to describe the displayed ratings. If you do not want any further labelling or if you want to keep the label short, this can be an empty string.
displayTwisty = (COLLAPSED)Use this parameter to specify the behavior of the twisty that is displayed as part of the inline rating widget. Valid values are COLLAPSED|EXPANDED|HIDDEN :
COLLAPSEDThe twisty is displayed but closed. Default.
EXPANDEDBoth the twisty and the widget are shown.
HIDDENThe twisty is not displayed. The widget is open and cannot be closed.
numStars = 5Use this parameter to specify the number of stars or asterisks of which a rating consists. Specify a positive numeric value. The default value is 5 .
onStarClickOpenDialog = true|falseUse this parameter to control whether a click on the asterisks of the rating starts the dialog rating widget.
onStarHoverShowRatingDistribution = (true)Use this parameter to control whether the rating distribution is displayed when the user hovers the mouse over the asterisks of the widget. The default is true .
ratingsChangedEvent = (ratingsChanged)Use this parameter to specify the event that informs the inline widget about changes to the ratings for the resource. This allows the inline widget to update the ratings set, for example if a user adds a rating in the dialog widget. The default value is ratingsChanged. The event name specified here must match the event name specified for the rating dialog widget.
ratingDialogWidgetParametersUse this parameter to specify a JSON object that contains optional configuration parameters for the rating 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 Rating dialog widget parameter reference. The mandatory 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, you cannot override the resourceID by specifying a different one in this object here.
ratingDistributionPosition = [30, 30]Use this parameter to specify an array that determines the top and left pixel position of the box that shows the rating distribution. The default is [30, 30] .
ratingScope = (COMMUNITY_PERSONAL_PUBLIC)Use this parameter to specify the scope of ratings that you want 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"]Use this parameter to specify an 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"] .
resourcePrivate = true|falseYou can set this parameter to avoid access control issues with private resources. Users can only add private ratings to private resources. The default value is false .
showDialogLauncher = true|falseUse this parameter to control whether a plus ( + ) button for starting the corresponding dialog widget is shown. The default is true .
Parent
Parameter reference for the tag and rating widgets
Rating dialog widget parameter reference
CP Configuration Service for tagging and rating