icon Page Comments
Created by Orckestra

How to add comments to a page

  1. From the Content perspective, add the Composite.Community.PageComments.Item datafolder to the page of your choice. This datafolder will store comments posted on the page.
  2. Edit the page and insert the Composite.Community.PageComments function ( Insert > Function), or add the following code:
    Expand code
  3. In the Newest at the Bottom property, select how comments should be sorted on a page: Newest at the bottom (True by default) or Newest at the top.
  4. In the Use Captcha property, select whether the form should use CAPTCHA. If 'true', the Captcha is used on the form. Default is 'false'.

Including comments from other pages

Optionally, you can configure the function to include comments from other pages on the current page, too:

  1. Edit the page with the Composite.Community.PageComments function and open the Function Properties window (right-click the function, click Function Properties).
  2. Select the Comment Filter property, change its Value type to Execute a function call, and launch Function Designer.
  3. In the Select Function window, select to add the Composite.Community.PageComments.Item.ActivePageReferenceFilter function.
  4. Now set the function's Page scope parameter: change its Value type to Specify a simple value and select the option that best meets your requirements.

By default, the filter is set to only include comments from the current page ("Current page"). The parameter, however, has many other options. For example, you can choose to include comments from the current page and its ancestor pages ("Ancestors and current page (breadcrumb)") or even comments from all the pages on the website ("All pages (no filter)").

Getting notified when a comment is posted

Additionally, you can set up email notifications every time a comment is posted on a page. (By default email notifications are not configured.)

  1. Configure the email host (please see "Email Host Setup").
  2. Add the Composite.Community.PageComments.Settings metatype to the page.
  3. Edit the page, and on its Metadata tab, in the E-mail field, enter the email address, to which email notifications will be sent.
  4. Save the changes.

Hiding the comment form on a page

If you want to only show comments on a page disallowing users to post comments, you can hide the comment form on a page. (By default, the comment form is visible.)

  1. Add the the Composite.Community.PageComments.Settings metatype to the page if you have not added it yet.
  2. Edit the page, and on its Metadata tab, in the Hide the comment form check box, place a check mark.
  3. Save the changes.

Important Notes

  • Before adding the Composite.Community.PageComments function, you should first add the Composite.Community.PageComments.Item datafolder.
  • Adding the Composite.Community.PageComments.Settings metatype to a page is optional and only required if you want set up email notifications or hide the comment form on a page.
  • To be able to send notifications by email when comments are posted, make sure that you have configured an email host by editing ~/web.config and including the /configuration/system.net/mailSettings section.
  • If the user uses markup tags in the Comment field on a page, he or she will get an error ("A potentially dangerous Request.Form value was detected from the client"). This is the default ASP.NET behavior ( see more information). To override this behavior

    edit \Renderers\Page.aspx, add validateRequest="false" to the Page directive:
    Expand code