ContentReview
The ContentReview server control lets site visitors rate content on your site. Place this control on a template that displays content items or eCommerce products. For example, you place this control on a Master page and set its DynamicParameter
property to ID. Then, when a Web form containing a content item or product passes its ID to the QueryString, a site visitor can use the control to record a review.
You can use the ContentReview server control as follows:
- Place a star-based scale on a Web page. Site visitors use the scale to rate a content item. Depending on the XSLTExtensible Stylesheet Language Transformations, they can also submit review comments.
- Display reviews and comments about a content item, or by a specific site or membership user.
See also: User-Ranking of Content.
NOTE: On a PageBuilder page, you can insert a ContentReview server control using the Calendar widget. See also: Creating and Using Widgets. The eCommerce Product List server control also can display the star-based scale.
Inserting the ContentReview server control onto a page
Prerequisite
You must have installed the server controls. See Installing server controls into Visual Studio Toolbox.
- In Visual Studio, choose View > Toolbox.
- Click the Ektron server control tab to display the server controls.
- Drag the ContentReview server control and drop it into the desired location on the page.
NOTE: You also can place the cursor on the page where you want the server control, then double click the server control that you want.
<CMS:ContentReview ID="ContentReview1" runat="server" />
- Click on
ContentReview
in the code to display and modify the control’s properties using the Properties window of Visual Studio. The page is updated as you modify the property values.
ContentReview properties
The following are Ektron-specific server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. properties. For information about native .NET properties such as font, height, width and border style, use Visual Studio® help.
- DefaultContentID (Long)
The ID of a content block being rated by this server control. If you don’t know the ID number of the content block, use the CMS Explorer to browse to it.See also: Browsing your Ektron site using CMS Explorer
- DisplayXslt (String)
Select the type of review to display, or enter the path to a custom XSLT. For additional information, see Using the DisplayXSLT property. Choices are:
- Ajax 5 Stars. A 5-star rating system utilizing Ajax for display.
- Ajax 5 Stars Comment. A 5-star rating system utilizing Ajax for display. When you hover over the stars, a comment box appears. Comments that are added are submitted via an Ajax call.
- Ajax 5 Stars with Increments. A 5-star rating system with half star increments that utilizes Ajax for display.
- 5 Stars. A 5-star rating system that allows visitors to add text reviews of content.
- 5 Stars with Increments. A 5-star rating system with half star increments that allows visitors to rate and add a text review of the page's content.
- Review List. Displays a list of reviews for content or a user.
- Path to Custom Xslt. If desired, enter a relative or absolute path to an Xslt that determines the display of the page.
WARNING! Files stored in the
siteroot\Workarea
folder are overwritten (or deleted) when you upgrade Ektron. To avoid problems, copy the default file to a folder outside thesiteroot\workarea
folder then edit it. If there is no default file, create the file outside thesiteroot\workarea
folder. Next, in this property, enter the path to that file relative to the site root folder. - DoInitFill (Boolean)
By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.
- DynamicParameter (String)
To make this content review control dynamic, select id. When you do, this server control is attached to the content block passed as a URL parameter.
- DynamicUserParameter (String)
When using this control to retrieve a user’s reviews, set this property to UserId to make the user’s ID dynamic.
- GetReviews (ReviewTypes)
Returns a list of reviews for content or a user.
- None. Do not return reviews.
- Content. Returns reviews based on the content ID provided in the
DefaultContentID
property. - User. Returns reviews based on the User ID provided in the
UserId
property.
- Hide (Boolean)
Hides or displays the output of the control in design time and run time.
- True. Hide the control output.
- False. Display the control output.
- Language (Integer)
Set a language for viewing content; shows results in design-time (in Visual Studio) and at run-time (in a browser).
- MaxReviews (Integer)
The number of reviews to retrieve if the
GetReview
property is set to Content or User. 0 (zero) = unlimited. - Moderate (Boolean)
Setting this property to True allows Ektron users to moderate reviews. See also: Moderating Reviews.
- RatingsMinimum (Integer)
Sets a minimum number of reviews before displaying the average rating. When set to 0 (zero), the average rating appears as soon as content is rated.
- SuppressWrapperTags (Boolean)
Suppresses the output of the span/div tags around the control.
- True. Suppress wrap tags.
- False (default). Allow wrap tags.
- UserID (Long)
The user ID for which to get reviews. If left blank, reviews from all users are returned. If a user ID is specified, only reviews for that user are returned.
IMPORTANT: The
GetReviews
property must be set to User for the control to use this property. - WrapTag (String)
Lets a developer specify a server control’s tag.
- Span (default). Designate an inline portion of an HTML document as a span element.
- Div. Apply attributes to a block of code.
- Custom. Lets you use a custom tag.
Using the DisplayXSLT property
Reviews communicate your site community's feelings about a product or article. They also give community members a voice. The ContentReview server control’s DisplayXSLT
property manages the display of reviews on your site. The control can display reviews for specific content or a specific user.
The following list shows an example of each XSLT as it appears on a Web page with a description and the XSL file being used. The files are located in webroot\siteroot\Workarea\Xslt.
WARNING! Files stored in the siteroot\Workarea
folder are overwritten (or deleted) when you upgrade Ektron. To avoid problems, copy the default file to a folder outside the siteroot\workarea
folder then edit it. If there is no default file, create the file outside the siteroot\workarea
folder. Next, in this property, enter the path to that file relative to the site root folder.
- Ajax 5 Stars.
rating5star.xsl
. A 5-star rating system utilizing Ajax for display. - Ajax 5 Stars Comment.
rating5starComment.xsl
. A 5-star rating system utilizing Ajax for display. When you hover over the stars, a review box pops-up. Visitor comments are submitted via an Ajax call. - Ajax 5 Stars with Increments.
rating5starinc.xsl
. A 5-star rating system with half-star increments that uses Ajax for display. - 5 Stars.
rating5starAddEdit.xsl
. A 5-star rating system that lets visitors add text reviews of content. - 5 Stars with Increments.
rating5starincAddEdit.xsl
. A 5-star rating system with half star increments that allows visitors to add text reviews of content. - Review List.
ratinglist.xsl
. Displays a list of reviews for content or a user.
Retrieving the XML structure of a ContentReview
Retrieving the XML structure of XML content allows for greater control over developing XSLs.
- Open a new Web form.
- Drag and drop a ContentReview server control onto it.
- Set the
DefaultContentID
property. - Drag and drop a textbox on the Web form.
- Set its
TextMode
property to MultiLine. You should set the width of the text box to at least 400px. - On the code-behind page, add the following line.
Textbox1.Text = ContentReview.XmlDoc.InnerXml
- Build the project.
- View the Web form in a browser. The XML structure of the collectiona list of Ektron content links for display on a Web page. appears in the textbox.