Add the rating widget to the portal content
By default, the rating widget is available for Web Content Manager article template pages and blogs and wikis. We can also add rating widgets to the portal content as required. To include a rating widget in a page or a portlet or other content, insert the following HTML snippet into your JSP or other code:
<div class="ratingLightWidget" resourceID= "${contentItem.URI}" > <div class="wpRatingLight"> <div class="label"> <div class="text"></div> </div> <div class="menuShow" role="link"> <a onkeypress="getRatingMenu('${contentItem.URI}')" onclick="getRatingMenu('${contentItem.URI}')" role="link" tabindex="0"> <img src='img_Src' border="0"> </a> </div> <div class="divider2Show"></div> <div class="description"> <div ></div> </div> <div class="divider1Show"></div> <div class="stars" resource > <div style="width: 70px;" class="empty" tabindex="0"> <div style="width: 0px;" class="full"></div> </div> </div> <div class="errorMessagedivider"></div> <div class="errorMessageStyle" > <img src='errorimg_Src' height="16" border="" width="16"> <label class="errorMessageText"></label> </div> </div> </div>Specify the appropriate values for the parameters:
These parameters are mandatory. For information about the optional parameters, read the Rating widget parameter reference.
- resource_ID
- For the resource ID, specify the identifier of the piece of content that we want to show the widget. This identifier needs to be unique. For example, for a portal page, specify the portal object ID of that page.
- xxxxx_src
- To obtain the values for the src attribute for the images, copy them from the src attributes for images from the Web Content Manager menu component. For each attribute, use the specific procedure:
- img_Src
- For the img_Src attribute, proceed as follows:
- In Web Content Manager, go to Applications > Content > WCM Authoring > Libraries > Web Resources v70 > Components.
- Select the check box for HTML - Rating Widget Light - Menu.
- Click Read and copy the src attribute value that you found here.
- Paste the value into your code for including the rating widget.
- errorimg_Src
- For the errorimg_Src attribute, proceed as follows:
- In Web Content Manager, go to Applications > Content > WCM Authoring > Libraries > Web Resources v70 > Components.
- Select the check box for HTML - Rating Widget Light - Messages.
- Click Read and copy the src attribute value that you found here.
- Paste the value into your code for including the rating widget.
Parent topic: The rating widget
References: