Home : Digital Asset Management : Plug Ins : Blog : Add Comments
Add Comments
The blog can be used to also add comments to regular HTML web pages. This is used to enhance the interactive nature of a Wiki or web site.

Setup Comments Area
To begin, you will need create a directory that will be used to store the comments. For our example we use /comments/
Next, you need to create two files:
first file - /comments/_site.xconf
Cut and paste the following into this new file and ensure your bloghome property matches the directory name you hve selected.
<page>
<property name="fallbackdirectory">/WEB-INF/base/blog</property>
<property name="bloghome">/comments</property>
</page>
second file - /comments/blogsettings.xml
Cut and paste the following into this new file and edit the fields as required.
<blog>
<title>OpenEdit User Forum</title>
<hostname>http://www.yoursite.com/</hostname>
<author>burkey</author>
<description>User forum for OpenEdit support requests</description>
<blogroot>/comments</blogroot>
<allow-anonymous-comments>true</allow-anonymous-comments>
<auto-publish-comments>true</auto-publish-comments>
<auto-publish-entries>true</auto-publish-entries>
</blog>
Add Comments Link
To enable comments on your selected page, two more actions are required.
First, you will need to add these settings to the top level /_site.xconf:
<path-action name="BlogModule.loadPermalink" />
<property name="bloghome">/comments</property>
note - you MUST place the text above between the <page> and </page> tags
example:
<page>
<path-action name="BlogModule.loadPermalink" />
<property name="bloghome">/comments</property>
</page>
Second, you must include the link to the comments area by adding these settings to the desired page. You can either do this directly or apply the comments to an entire section using your layout. Click here for further information on how to work with layouts.
#if( !$content.getPath().startsWith("/comments") )
<div class="post-footer">
Last Edited $entry.published("EEEE, MMMM d yyyy h:mm a") <a class="comment-link" href="$home/comments/permalink${entry.path}">$entry.countVisibleComments() comment#if( $entry.countVisibleComments() != 1 )s #end</a>
</div>
#end
note - ensure you use the correct directory name. In this example, we have used /comments
