Jump to content

Request to add Class to Submit Button in Comment Form


Zahari M.
 Share

Recommended Posts

Hi Ryan

Been working on styling the comments form and have come across the need to add classes to the submit button.

This is to add two Zurb button classes... small and radius.

To do this I had to go into the core to modify CommentForm.php

As others in the future may wish to style their submit buttons, it would be great if you could add the option for button classes when we run this... echo $page->comments->render(array

Thanks Ryan!

Link to comment
Share on other sites

Why not doing it with jQuery ?

// ps don't know the actual markup, so selector will be different I think.

$(".comment input[type=submit]").addClass("small radius");

Or you could move the comment module to ./site/modules/ and make the changes there. 

Nothing wrong with that aproach.

Link to comment
Share on other sites

Thanks Martijn and Soma for your replies!

3 great approaches from you both. That's awesome.

I never thought of moving out a core module to our sites folder and modifying it. But I feel most comfortable with that approach and I'm happy going with that.

Thanks for that link Soma. It contains a very instructional concept of great value.

Nontheless.... I still think it would be of great value for the comment form API to be able to accept a class for the submit button without using any of our workarounds!

We can currently configure just  about everything else that is needed via the API, so why not the submit class as well?

I'm very certain more people in the future who want to style the button would be looking for it expecting to find it in the API

Anyway... it was just a wish

Cheers guys!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...