1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Add Secondary Top Control?

Discussion in 'XenForo Development Discussions' started by Jaxel, Mar 1, 2011.

  1. Jaxel

    Jaxel Well-Known Member

    I have been using template hooks to add top control buttons. It worked great in the past with "threads"; now I am trying to add a top control to a forum... With the thread it worked great, but threads don't have their own top controls. With the forum, its not working at all... I assume its because the forum already has a top control and you can't add a second one? Is it possible to add a second top control?

    class EWRatendo_Listener_Template
    	public static function template_hook($name, &$contents, array $params, XenForo_Template_Abstract $template)
    		if ($name === 'forum_view_pagenav_before')
    			$contents .= $template->create('EWRatendo_ForumView', $params)->render();
    	<a href="{xen:link 'events/create/{$forum.node_id}'}" class="callToAction">
    		<span>{xen:phrase post_new_event}</span>
    DoctorWatsOn likes this.
  2. Jaxel

    Jaxel Well-Known Member

    Any words on this?
  3. Jaxel

    Jaxel Well-Known Member

    Still awaiting some words on this... =P
  4. DoctorWatsOn

    DoctorWatsOn Well-Known Member

    Can the guys answer this in view of THIS POST?
  5. xfrocks

    xfrocks Well-Known Member

    I did find a way to change the top controls section by listening to `template_post_render` and make the necessary change to $containerData (it's an array passed by reference so you can freely do whatever you want). Something like this

    if ('forum_view' == $templateName) {
    $containerData['topctrl'] .= '<a href="link-to-my-page" class="callToAction"><span>Click Me!</span></a>';

Share This Page