Add the dialog rating widget to the portal content
In a default portal installation the dialog rating widget is available for rating pages and portlets. We can make the dialog rating widget available for our own content.To make the rating widget available for our own content items use the following code:
- By using Javascript code:
var widget = new com.ibm.widgets.AddRating({ resourceID: myResourceID, resourceTitle: myResourceTitle });
- By using HTML markup:
<div dojoType="com.ibm.widgets.AddRating" resourceID="myResourceID" resourceTitle="myResourceTitle"></div>To add the rating widget declaratively, we can place it wherever you want within your html code.The parameter values have the following meaning:
- myID
- Specify an identifier that identifies the resource to make available for rating by the users. This needs to be unique.
- myResourceTitle
- Use this parameter to describe the underlying resource that the user wants to rate. The resource title is shown in the title header bar of the dialog rating widget.
For more parameters refer to the parameter reference for the dialog rating widget.
Parent: The dialog rating widget