Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

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

  • Options
    BleistivtBleistivt Moderator
    edited January 2015

    Yes, DiscussionController_AfterBodyField_Handler.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

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

  • Options
    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.

  • Options
    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

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    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.