Documentation Center

Enabling commenting and rating in a Template

Enable commenting and rating in a Template to let users see and submit comments and ratings on Web pages that were rendered with such a Template, or on Web pages that contain Component Presentations rendered with such a Template.

About this task

You need to decide which Component Template(s) and Page Template(s) you want to enable ratings and/or comments. Pages or Components rendered with these templates will then display the following information on the published Web page:

  • the current average rating
  • an interface to submit a rating
  • all the comments posted so far (paginated if needed)
  • a form to provide a new comment

Procedure

  1. Start Template Builder.
  2. Open one of the Templates in which you want to enable commenting and rating.
  3. If this is the first Template for which you want to enable commenting and ratings, select Tools > Create Default Building Blocks.
    New Template Building Blocks are added to the Building Blocks area on the left. In Content Manager Explorer, new items will also appear in the Building Blocks\Default Templates folder of this Publication
  4. Insert the Template Building Block Enable User Generated Content Processing before the Template Building Block that generates your output (typically your Dreamweaver Template Building Block) in the Template.
  5. Modify the Template Building Block that generates your output so that it displays ratings and comments and allows visitors to set ratings and add comments.
    The Enable User Generated Content Processing makes a number of TCDL tags available that you can use to do this. You can use the Default UGC Dreamweaver Template Design Template Building Block as example of how to work with comments and ratings. Note however that this Template Building Block does not produce any output.
  6. Save and close your template.
  7. Repeat the same procedure for all other Component Templates and Page Templates for which you want to enable commenting and rating.

What to do next

The templates now add ratings and comments to Components or Pages they render, unless a user explicitly configures those Components or Pages not to show ratings and/or comments.