Guestbook in Movable Type 4

| Comment

We have a new client who wanted to add a good old fashioned guestbook to their new site - so naturally we obliged. I came up with a quick and simple guestbook utilizing the MT Entry template, the Comment Form template, and a single entry. Since the site we are working on is running MT 4 but we were only using "Pages" for their content, we had the Entry and Comment Form templates available to carve up at will and didn't need to create a whole new blog (like some older examples do).

This is basically what I did:

  1. Stripped the Entry template and put my simplified code in there (the code that gives the Entries the same look and feel as the rest of the site)
  2. Added back into the body the mt:EntryBody tag (the title of the page is an image and that is hard coded in the entry)
  3. Below that, added the mt:Include module="Comment Form" tag
  4. Don't forget to make sure that the javascript link remains in the head of the document if you strip it clean like I did (hat tip to Tim Appnel)
  5. Save and publish this.

So since the only "Entry" is the guestbook itself, that is pretty much it for the Entry template. The other main modification is to the Comment Form template. Here is what I did there:

  1. Changed the instances of "Comment" to "Guesbook" where necessary
  2. Displayed the comments below the form (basically just cut and pasted the whole chunk of code)
  3. Commented out/deleted the URL field and other extraneous links and information (replies, preview, etc.)
  4. Did some styling of the template to make the comments stand out
  5. Save this and publish again.

Now for the guestbook "Entry" itself. All I needed to do was put a little intro text into this post and ask people to sign the guestbook. Everything else is in the other templates.

The last part is the configuration. Of course when someone "signs" this guestbook, they are actually leaving an comment, so comments have to be set to "On" in the post itself (and in this case, since we are using MT as the CMS the comments for the "Pages" are set to "Off"). In the registration settings, only "Anonymous Comments" is checked - leave all other boxes unchecked. In the Comment Settings preferences check the box for "If enabled, comments will be accepted", choose the radio button "Anyone", "E-mail Notification" should be "On", "Comment Order" is set to "Descending" and the "CAPTCHA Provider" is Movable Type default (I would assume you could get this working with ReCaptcha but we didn't try).

That is pretty much it - you can see it working here, but please don't fill it up with fake comments! Drop me a line if you try this method and need some help.

One troubleshooting note - the comments were showing up twice at first and I can't remember where from but I had to strip one instance of this from one of the templates... :)

comments powered by Disqus  

Enter your email address:

Delivered by FeedBurner