Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

How to add a textbox into the Comment Form?

luasoftluasoft New
edited January 2015 in Vanilla 2.0 - 2.8

To add a textbox into the Discussion form, i used the hook:

public function PostController_AfterDiscussionFormOptions_Handler($Sender) {
    echo '<input type="text" name="Options" >';
}

and now, i want to add a text into the Comment Form,

is there the PostController_AfterCommentFormOptions_Handler($Sender) {} hook or a similar hook?

thanks!

Tagged:

Comments

  • BleistivtBleistivt MVP
    edited January 2015

    Yes, DiscussionController_AfterBodyField_Handler.

    luasoftjackmaessen
  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    Try the eventi plugin if you are looking for hooks. It will help you find the hooks you are looking for


    Bleistivtluasoftjackmaessen
  • x00x00 MVP
    edited January 2015

    Like I said use the form builder, rather then hard coding the input.

    It is also worth looking at the context of the hook, in this case a view. As that will tell you what is appropriate.
    That is why I recommend grep, if you can't find something.

    Say for instance you have options, and the view loop through "options", and the hook has the "options" argument passed by reference. In that case and echo is wrong, becuase the loop takes care for that, it would be out of place, instead you would add to the options collection.

    So check to see how exactly you would output when using any form/views hooks.

    grep is your friend.

  • luasoftluasoft New
    edited January 2015

    @Bleistivt said:
    Yes, DiscussionController_AfterBodyField_Handler.

    great, thanks

    @R_J said:
    Try the eventi plugin if you are looking for hooks. It will help you find the hooks you are looking for

    thanks, installed but it's not working on version 2.1.8p2

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    As far as I know the icons do not appear any more (since 2.1?), but that would be the only difference. It should still add markup to each page where there is an event fired and give you additional info there.


Sign In or Register to comment.