Textpattern comment form components

admin-ajax

Textpattern CMS comment form tags are vital to the construction of a comment submission form Without them, there’s no form. That said, there’s no requirement to use every single comment tag to build a form. Here’s the list – and it’s big:

  • comment_email
  • comment_email_input
  • comment_message
  • comment_message_input
  • comment_name
  • comment_name_input
  • comment_web
  • comment_web_input
  • comments_preview
  • comment_preview
  • comment_remember
  • comment_submit
  • comments_error
  • comments_help

With the allocated space I have here it’s not possible to get into the level of detail I’d like to – there are other Arvixe Community Liaisons ready to write their stuff here, too, don’t forget – so I’ll compromise and give you an overview for each tag instead.

From the list above, you may spot some similarities between tag names. For example:

  • comment_email
  • comment_email_input

These relate, unsurprisingly, to the commenter’s supplied email address. Specifically, the `comment_email` tag is used to display the localised language string for the `Email address:` label. The `comment_email_input` renders the form field into which the email address can be typed. These two tags typically work alongside each other on a page, and the same goes for the following three pairs of tags in the big list above, too:

  • comment_message
  • comment_message_input
  • comment_name
  • comment_name_input
  • comment_web
  • comment_web_input

Again, three labels, three corresponding boxes in a form. The `comment_message` is the guts of the comment itself; whether it’s insightful and helpful or just YouTube-esque abusive drivel is down to your readership. The `comment_name` is the comment author’s name. Finally, `comment_web` is the field where a commenter can have their own website address included on the form if they have one. As an aside, and this will make more sense when my next article is published, whether or not you decided to publish any or all of this information is entirely up to your comment display form.

It’s bad form to display commenter’s email addresses online, especially without their permission, as the inevitable deluge of spam will probably be a Bad Thing. That said, it’s useful to have a genuine email address from the commenter should there be a need to contact them outside of the confines of the website. Conversely, most people are very happy to have their own website listed in a bunch of places, especially with links leading from high quality Textpattern sites, but you may not want to dilute your website page rank with a tonne of outgoing links.

There’s also an option to have the browser set a cookie and remember the name, website and email address of the commenter:

  • comment_remember

The big list at the top has now shrunk down a bit:

  • comment_preview
  • comment_submit
  • comments_error
  • comments_help

Briefly: `comment_preview` spits out a `Preview` button for the commenter to see what their tome looks like, then `comment_submit` sends the comment to the moderation queue. A reminder: a comment preview is required before the submit button will activate. This cuts down on a huge amount of website spam, but is an extra step in the commenter’s workflow, which might not be right for all demographics. Me? I’ve had ten years to get used to it, so it’s not a big deal.

Finally, `comments_error` will display a localised error string if there was a required form field left blank, and `comments_help` provides the commenter some useful info on what they can use for formatting their comment.

For more information on these and other Textpattern comment tags, check out the comment tags reference at Textpattern Resources

Next time: publishing moderated comments.

Looking for quality Textpattern Hosting? Look no further than Arvixe Web Hosting and use coupon TEXTPATTERN for 20% off your first invoice!

Tags: , , , , , , , , , , , , | Posted under Textpattern | RSS 2.0

Author Spotlight

Pete Cooper

Pete Cooper has been using Textpattern since 2005. Textpattern is his preferred CMS weapon of choice. Its logical and flexible approach to content management makes Pete happy, as does its lightweight core and helpful user community. Pete's website - petecooper.org - runs on top of Textpattern and chronicles his day-to-day experiences from his home near the Atlantic in north Cornwall, United Kingdom.

Leave a Reply

Your email address will not be published. Required fields are marked *