EllisLab text mark
Advanced Search
     
Extension: Comment Form Tag
Posted: 24 April 2010 12:24 PM   [ Ignore ]
Avatar
Joined: 2007-02-02
981 posts

The attached add-on files may be out of date.  Please visit Devot-ee for the latest versions.

This extension makes it possible to add or change CSS attributes of the comment form HTML element.

The problem this extension solves is this: exp:comment:form tag is parsed after all other EE tags which start with “exp”. The result of this is that it is impossible to add or change any of CSS attributes of the HTML form element this tag outputs by wrapping exp:comment:form with some other tag, such as exp:replace or exp:replace_plus. That is, this will not work:

{exp:replace find="comment_form" replace="my_comment_form"}
{exp
:comment:form}
{
/exp:comment:form}
{
/exp:replace} 

Using Comment Form Tag extension you can add or change any of CSS attributes of the HTML form element exp:comment:entries outputs by adding inside this tag one or more “comment_form_tag” variables. “comment_form_tag” variable supports following parameters:

1) parameter - required. Allows to specify name of CSS atribute of HTML form element.

2) value - required. Allows to specify value of CSS atribute of HTML form element.

EXAMPLE
The code

{exp:comment:form entry_id="10" preview="site/comment_preview"}
{comment_form_tag parameter
="id" value="comment_form_general"}
{comment_form_tag parameter
="class" value="my_form"}
{
/exp:comment:form} 

will output form tag having following CSS attributes:

<form id="comment_form_general" class="my_form"
 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

 
Posted: 25 April 2010 05:59 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2007-07-04
459 posts

Nice

How easy would this be to convert for the other forms that don’t allow for class names, (can’t remember which but at a guess based off the latest 2.0 update: tell-a-friend, simple and advanced search, stand alone entry form, comment, mailing list forms)?

 
Posted: 26 April 2010 03:05 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2007-02-02
981 posts

Hi,

This is EE 1.x extension. It uses comment_form_end extension hook.

These are analogous hooks:

edit_wiki_article_form_end
forum_submission_form_end
publish_form_end
weblog_standalone_form_end

It is possible to attach extension’s method to any or to some of these hooks. It seems to me that there is sense to attach extension’s method to weblog_standalone_form_end hook; I don’t find any reasons to attach it to other aforementioned hooks.

How do you think?

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

 
Posted: 18 May 2010 06:08 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2007-08-14
231 posts

What a great little extension Laisvunas - just saved me some time. Thanks!

 Signature 

Jim Pannell | Six Media Web Development | Copenhagen, Denmark
Twitter: @jimpannell