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

XF 1.3 'Post new thread' button

Discussion in 'XenForo Questions and Support' started by KVMG, Jun 6, 2014.

  1. KVMG

    KVMG Member

    On a forum, the button appears both at the top (to the right of the breadcrumbs) and at the bottom of the thread list as well. Excellent.

    On a page listing sub-forums, however (http://hc.kvmgalore.com/index.php?forums/ASK/) the button appears only at the bottom of the list.

    How can I have the 'Post new thread' button also appear at the top of this page (to the right of the breadcrumbs)?
     
  2. Tracy Perry

    Tracy Perry Well-Known Member

    Duplicate what is in the forum_view template on the default style on your style (if it's a custom?), specifically the topctrl section?

    Code:
    <xen:if is="{$canPostThread}">
        <xen:set var="$newDiscussionButton"><a href="{xen:link 'forums/create-thread', $forum}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a></xen:set>
        <xen:if is="!{$renderedNodes}">
            <xen:topctrl>{xen:raw $newDiscussionButton}</xen:topctrl>
        </xen:if>
    </xen:if>
    
     
  3. KVMG

    KVMG Member

    My style is not custom - I'm using the Default Style.
     
  4. Russ

    Russ Well-Known Member

    This is just a quick test but you could try this:

    forum_view

    Find:
    Code:
    <xen:if is="{$canPostThread}">
       <xen:set var="$newDiscussionButton"><a href="{xen:link 'forums/create-thread', $forum}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a></xen:set>
       <xen:if is="!{$renderedNodes}">
         <xen:topctrl>{xen:raw $newDiscussionButton}</xen:topctrl>
       </xen:if>
    </xen:if>
    
    

    Remove the conditional:

    Code:
    <xen:if is="{$canPostThread}">
       <xen:set var="$newDiscussionButton"><a href="{xen:link 'forums/create-thread', $forum}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a></xen:set>
         <xen:topctrl>{xen:raw $newDiscussionButton}</xen:topctrl>
    </xen:if>
    
    Then it'll have two buttons(original location and the breadcrumb)

    add to extra.css:

    Code:
    .nodeListNewDiscussionButton
    {
       display: none;
    }
    
    There's probably a better way of doing it, and honestly my way could have an adverse effect however it appears to be working fine.
     
    Tracy Perry likes this.
  5. KVMG

    KVMG Member

    Thanks! I'll check it out and let you know.
     
  6. KVMG

    KVMG Member

    I've implemented this and it appears to do the job.

    I haven't come across any adverse effects yet.

    Thanks!!!
     
  7. Joe Link

    Joe Link Well-Known Member

    Thanks @Russ

    Why does the button render differently when there are sub-nodes?
     

Share This Page