Knowledgebase

Adding a blog like page commentary feature to pages.

This development was undertaken to fulfill the needs of sites which want to provide comment blogs to editorial and news article pages. It is an extension of previous (undocumented) work which allows for guestbook (and forum) XML islands.

Guestbook XML islands

Like other XML islands – a piece of XML in a layout or content type (possibly via a global variable block) defines a functional element to be dropped into the HTML at that point.

In the case of a guestbook then all the info we need is the guestbook ID so the XML snippet will look something like:

<GUESTBOOK><GUESTBOOKID>356</GUESTBOOKID></GUESTBOOK>

This will be replaced with a guestbook at that point in the code. Note that it will have links to “add to guestbook” and “view guestbook archive” which will take users to the same page with the relevant guestbook HTML at the same point in the HTML. This can be a little inconvenient if there is a lot of text before the guestbook part of the page as it would involve in knowing that scrolling down would be required to reach the relevant part. However it is not envisaged that this functionality will be widely used except perhaps to gain more control over header and footer of a guestbook page. This functionality has been developed as an initial step towards Comment Blogs (next section).

Comment Blogs

Comment blogs are aimed to give visitors to a site the chance to add comments to editorial pages and news articles. Our implementation is based on our guestbook functionality and Guestbook HTML islands in particular.

Comment blogs are implemented in the same way as guestbook XML islands but no guestbook ID is specified. If a visitor adds the first message (comment) to a page (or news article) then a new guestbook is created on the fly. For this reason it is necessary to define the configuration of the guestbook (or accept the defaults). So the XML snippet could look something like the following (same fields as admin/guestbook/config):

<GUESTBOOK>
<BLOG>1</BLOG>
<MODERATED>1</MODERATED>
<APPROVETOEMAIL>bob.paul@sitekit.net</APPROVETOEMAIL>
<DAYSTOARCHIVE>100</DAYSTOARCHIVE>
<SHOWADDRESS>1</SHOWADDRESS>
<SHOWTELEPHONE>1</SHOWTELEPHONE>
<SHOWPROFESSION>1</SHOWPROFESSION>
<USEDIVS>1</USEDIVS>

</GUESTBOOK>

If any of these are left out the defaults are as follows:

MODERATED Default = false
APPROVETOEMAIL Default = "" - no email sent
DAYSTOARCHIVE Default = 365
REQUIREEMAIL Default = false
SHOWADDRESS Default = true
SHOWTELEPHONE Default = false
SHOWPROFESSION Default = false
USEDIVS Default = false

The name of the new automatically created guestbook needs to be unique and will be of the form:

Blog_#PAGEID#_#LANG#

Where #PAGEID# is the unique ID from the editorial table and #LANG# is the language of the page

Rather than use this guestbook name in headings/buttons etc the following fixed text is used (from the dictionary):

Submit Comment
Leave a Comment
your comment has been added
Back To Latest Comments
Archived Comments
View Archived Comments
There are currently no archived comments
You must enter your name before you can leave a comment on this page
all comments are moderated - your submission will be posted on approval
Comments
Comment

Blog Workflow

For guestbook XML islands there is potentially the problem of having to scroll down to add a submission. For this reason the add a submission form has been added at the bottom of the guestbook rather than via a button link.

Sitekit CMS are looking at moving the “view archive” button below the “add a comment” form – for a better order on the page.

Changes to Guestbooks Module

Item 4 above left the page commentary feature more open to attacks from automatically submitting the form multiple times. For this reason we have added some extra security to the guestbook module:

"show gender” and “show age” from the admin configuration.

“show address” has been added to the config so that address details can be removed from the form (particularly with comment blogs and when the form is on many pages, it makes sense to keep superfluous information to a minimum).

The “require email” checkbox functionality has been improved and text added on the front end form to assure visitors that their email address will never be displayed.

The "useDivs" option has been added to allow users to make non table based page commenting blocks and guestbooks