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

Create new thread button

Discussion in 'Styling and Customization Questions' started by Lee, Apr 3, 2013.

  1. Lee

    Lee Well-Known Member

    In which template can I find the HTML for this button? :)

    topCTRL.png
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The forum_view template contains the HTML but the styling can be done in Style Properties.

    HTML:
    <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>
     
    Wysie and Shelley like this.
  3. Shelley

    Shelley Well-Known Member

    You could create a new design for the button with css and save on the template edit.

    a.callToAction
    a.callToAction span

    But I'm sure the template your wanting is forum_view

    edit: Ninja'd
     
  4. Lee

    Lee Well-Known Member

    Sweet, thanks.

    I'm using it to replace the thread creation button with that of a custom form in a certain section.

    Works a charm.
     
  5. it_

    it_ Member

    @Lee just what I'm looking for here.
    Idea is to exchange the Post New Thread Button with a different button (that links anywhere) in a certain forum.
    Would very much appreciate your code editings!
     
    Last edited: Aug 4, 2013
  6. Deepmartini

    Deepmartini Well-Known Member

    You could also make the button blink or glow.
     
  7. 0ptima

    0ptima Well-Known Member

    In the forum_view template 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>
    replace it with

    Code:
    <xen:if is="{$canPostThread}">
    <xen:if is="in_array({$forum.node_id}, array(X, Y, Z))">
        <xen:set var="$newDiscussionButton"><a href="http://newlink.com" class="callToAction"><span>New Link</span></a></xen:set>
    <xen:else />
        <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>
    
    X, Y,Z are node IDs, which you need to adapt to your forum
     
    it_ likes this.
  8. it_

    it_ Member

    @Optima
    Thanks, just what I needed. ;)
    Note: One </xen:if> is missing in your code.

    Now, there is still this 'Post New Thread' Button on the bottom, where can I find the equivalent code?
    Thanks, best regards!
     
  9. 0ptima

    0ptima Well-Known Member

    Further down in the template. do a search for "create-thread" and adapt the code.
     

Share This Page