Adding a UGC configuration to the Content Delivery Web services

Edit your UGC configuration file for both Content Delivery Web services to set a scoring threshold and a whitelist for comments.

Procedure

  1. Access the SDL Tridion installation media.
  2. Navigate to the Content Delivery\resources\configurations\ folder.
  3. Navigate to the root directory of one of your Content Delivery Web services.
  4. Copy the cd_ugc_conf.xml to the location where your Content Delivery Web service is running:
    • In a JSP Web application, in the WEB-INF/classes/ directory.
    • In a .NET Web application, in the bin\config\ subfolder.
  5. Open cd_ugc_conf.xml in a plain-text or XML editor.
  6. In the <Comment> section, configure the following subelements:
    ScoreMinimumThreshold
    Indicates the minimum score that a comment must have in order to be removed from the published Web page and offered to a moderator. This property defaults to the value "-10". Comment score depends on the amount of positive votes ('likes' or 'upvotes') and negative votes ('dislikes' or 'downvotes') that the comment has received. Every upvote raises the comment score by 1; every downvote lowers it by 1.
    WhiteList

    This section lists XHTML tags that you want to allow to be read and processed in a comment (any tags not in this list are ignored). Represent each XHTML tag as a Tag element with its Name attribute set to the name of the tag you want to allow. For example, <Tag Name="em" /> lets commenters use the <em> tag in a comment.

    Also, you can force certain attributes of a tag to have a certain value by creating a subelement of the format <Attribute Name="ATTRNAME" EnforcedValue="ATTRVALUE"> where ATTRNAME is the attribute you want to set a value for, and ATTRVALUE is the enforced value for that attribute, which overwrites any existing value.

    Specifically for the a tag, you can also enforce only certain protocols (say, only links to http:// resources, not https:// resources), create a subelement <Attribute Name="href"> with a subelement <Protocol Name="http"/> where http is the protocol you want to allow.

    Here is an example of an XHTML white list. It only allows bold, italic and underlined text; soft returns in text; and links to HTTP resources only, which should not be followed by search engines and should open in a new tab or window.

    <WhiteList>
      <Tag Name="a">
        <Attribute Name="href">
          <Protocol Name="http"/>
        </Attribute>
        <Attribute Name="rel" EnforcedValue="nofollow"/>
        <Attribute Name="target" EnforcedValue="_blank"/>
      </Tag>
      <Tag Name="b"/>
      <Tag Name="br"/>
      <Tag Name="i"/>
      <Tag Name="u"/>
    </WhiteList>
  7. Save and close cd_ugc_conf.xml.
  8. Repeat the steps above for your second Content Delivery Web service Web application.