Jump to content

Add template hook point to topicViewTemplate reply-form?


TSP

Recommended Posts

Hi, I'm making a hook and I see no way to add a new input box inside the fieldset for the fast reply controls. Could this be done? Or is there another way to achieve adding an input box there with a hook? Want to keep template edits to a minimum and the hook also require some setting checking to check if it can be displayed.

edit: and I want a hook point in front of the reply button on the full reply page. (postFormTemplate)

Link to comment
Share on other sites

Javascript:

$( 'fast_reply_controls' ) .insert( {top: new Element( 'input', { type: 'text', name: 'name', id: 'id' } ).defaultize( 'default text' ) } );

Hook with replaceOutput

public function replaceOutput( $output, $key )

{


$tag = "<fieldset class=&#39;right&#39; id=&#39;fast_reply_controls&#39;>";

$pos = strpos( $output, $tag );



$string = $this->registry->getClass(&#39;output&#39;)->getTemplate(&#39;topic&#39;)->templateToInsert();


if( $pos )

{

    $output = substr_replace( $output, $string, $pos, 0 );

}

return $output

}


This act as a template hook, and can be loaded with any of the available template hooks in the template.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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