Configuring UGC

To configure User Generated Content, edit your User Generated Content configuration file, cd_ugc_conf.xml to set a scoring threshold and a whitelist for comments.

Procedure

  1. In the configuration location of the service, open cd_ugc_conf.xml for editing.
  2. 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.

    The following is an example of an XHTML whitelist. 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>
  3. Save and close cd_ugc_conf.xml.