Quick Tags for comments

Since Alex released his js quick tags - it seemed like the perfect thing to add to the comments form so that people could put in the html tags more easily. However, while his script is really powerful - just for the comments form, it’s more than what’s needed. So I stripped it down to the most basic version - using only the most common HTML tags used in comments - italic, bold, and links.

Here are the instructions on how to integrate it into your (wordpress) comments:

First and foremost - if you want to add code, or use the full version - you can download that from Alex’s site.

To use the “mini” version I made:

1) Download the js file and upload it to the root of your domain.

2) Open up your wp-comments.php page… Look for the beginning of the comments form - (search for <form in the file) and put this just above it:

<script src=”/js_quicktags-mini.js” type=”text/javascript”></script>

Look for the text area field for comments which looks like this <textarea name=”comment” id=”comment” cols=”40″ rows=”6″ tabindex=”4″></textarea> and add this directly above it:

<script type=”text/javascript”>edToolbar();</script>

And add this BELOW the textarea field:

<script type=”text/javascript”>var edCanvas = document.getElementById(’comment’);</script>

This is the method I’m using on this site - although I added the “h3″ tag just for the one I use, since that’s what I use to stylize code on this site. You can easily add more… or start from scratch using Alex’s.

12 Responses to “Quick Tags for comments”

  1. monique Says:

    these are great! it definitely makes it easier for commenters and i think it looks better than having that list of “tags you can use.” it really cleans up the page!

    Scripty does it again! =)

  2. Andrew Says:

    Hehe..Customising this script must be the ‘flavour of the week’ atm. I made this version, which is stripped down to just the dictionary function and a thesaraus function which I added. I’ve used it already for a personal project and found it indespencable [if you had the dictionary function I would have spelled that correctly :p]

  3. Mo Says:

    Nice Hack

  4. :: mathibus.com » archives » wordpress: redesigning the comment form Says:
    [...] efore those rather big changes, he messed around with the comment form. The new things are the mini quicktags, a resi [...]

  5. Tek Says:

    How come your buttons are nice and rounded? Mine don’t look like that at all. *scratches head*

  6. Jennifer Says:

    You probably have a style applied to input tags - that will automatically square-off the corners. (I don’t have any styling to input tags)

  7. Mama Write Says:
    Various WordPress Links
    Rather than ping ScriptyGoddess multiple times and clog my sideblog with even more WordPress links, I decided to plop ‘em all here. I’m going to give WordPress a try again on my course website, since there are various hacks that…

  8. Marius Says:

    Thank you Jennifer…man…I’m getting a ton of good scripts of here. Tell ya, I’m very greatful.

  9. Monty Says:

    Another very helpful hack from you.

    Thank you!!

  10. Poonam Says:

    Jennier - I am using this script and its great. But I also want to be able to use the strikethrough in comments. How would I go about adding that to the list? Your help would be very grateful. Thank you. :smile:

  11. Jennifer Says:

    Poonam - give this a try. In that .js file, you’ll see a few other “edButton” definitions. Add this one after the last one (which in my file is the one to make links) :

    edButtons[edButtons.length] = new edButton(’ed_strike’, ’strike’, ‘<strike>’, ‘</strike>’);

    I haven’t tested it, but that should work.

  12. Poonam Says:

    Thank you so very much Jennifer! You are the best! I tested it and it works fabulously! :) Thank you again!