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

XF 1.3 Move Post New Thread Button

Discussion in 'Styling and Customization Questions' started by Mouth, Mar 25, 2014.

  1. Mouth

    Mouth Well-Known Member

    Users find it un-intuitive to find the Post New Thread button at the top, due to it being inconsistent with the bottom location and away from the forum content. Thus I would like to move it, as shown in below screenshot, so that it resolves both these issues. In which template(s) would I have to adjust to move the button? Thanks.

    nrep likes this.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The template is forum_view.

    The relevant code is:
    <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>
  3. Mouth

    Mouth Well-Known Member

    Thanks Brogan.

    To move/replicate it to my desired location, it appears it has to go into the page_container template, just above
    <xen:hook name="page_container_content_title_bar">
    with something like
    <div style="float:right">
    Insert Post New Thread button code here
    But then it will appear on all pages. Is there a 'xen:if is=' statement that I could use to wrap around it determine that I'm at a forum_view page only?
  4. Brogan

    Brogan XenForo Moderator Staff Member

  5. Mouth

    Mouth Well-Known Member

    Thanks again Brogan. I now have
    and it's only appearing on the forum_view page, but instead of producing the button it's instead giving the elseif and showing phrase no_permission_to_post. I assume that {$canPostThread} is not available within page_container? Is there something else I can (should be) using instead within page_container?
  6. Brogan

    Brogan XenForo Moderator Staff Member

    The permission is specific to each forum so that check can only be done within each forum.
  7. Russ

    Russ Well-Known Member

    Unless I'm missing the obvious... why not just move that button a single time. We have this as an option in our framework:



    <xen:if is="{$topctrl}"><div class="topCtrl">{xen:raw $topctrl}</div></xen:if>

    Remove from the breadcrumb, we placed ours right of the title:

    so place that snippit above:

    <xen:if is="{$pageDescription.content}">



    Button will only show if they have access to a button there(like default)
    viper357, maszd, Tim Jay and 7 others like this.
  8. Mouth

    Mouth Well-Known Member

  9. PrettyPixels

    PrettyPixels Active Member

    This helped me too. Thank you! :)
  10. ge66

    ge66 Active Member

    Thank you for this!
    Could you please help with how one should do it if the forum has subforums, I think I want the button in the same place and not below the subforums as it is now.
  11. rwm1962

    rwm1962 Active Member

    Can anyone tell me please how to move the button to the left & below the node desription (& just to the left on nodes with sub-forums)?
  12. bibitbunga

    bibitbunga Member

    This helped me a lot. Thank you @Russ :)
  13. swatme

    swatme Well-Known Member

    hi guys

    any idea how to change the color of the POST NEW THREAD?
    also i want to make it bigger

  14. Amaury

    Amaury Well-Known Member

    Style Properties > Buttons

    It'll be the call to action ones.
  15. swatme

    swatme Well-Known Member

    i see...

    What if i want to make it specific to the POST NEW THREAD button only?
    what should i do to make it red color button, without affecting the other buttons...


Share This Page