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

XF 1.4 Change text on Post New Thread button?

Discussion in 'Styling and Customization Questions' started by DaveL, Jan 13, 2015.

  1. DaveL

    DaveL Well-Known Member

    Is it possible or is there a modification available that will you allow you to change the next on the 'Post New Thread' button in selected forums?
  2. Amaury

    Amaury Well-Known Member

    DaveL likes this.
  3. DaveL

    DaveL Well-Known Member

    Ive managed to change the top "Post New Thread" button in a selected forum using a conditional, however im struggling with the bottom one.

    This is the code im using to change the top "Post New Thread"

    <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 is="{$forum.node_id} == 35">
    <xen:if is="{$canPostThread}">
        <xen:set var="$newDiscussionButton"><a href="{xen:link 'forums/create-thread', $forum}" class="callToAction"><span>{xen:phrase post_launch_thread}</span></a></xen:set>
        <xen:if is="!{$renderedNodes}">
            <xen:topctrl>{xen:raw $newDiscussionButton}</xen:topctrl>
    Can anyone advise where I would add my conditional into the code below for the bottom button? Ive tried a variety of ways but not having much luck!

    <xen:if is="{$canPostThread}">
                <a href="{xen:link 'forums/create-thread', $forum}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a>
            <xen:elseif is="{$visitor.user_id}" />
                <span class="element">({xen:phrase no_permission_to_post})</span>
            <xen:else />
                <label for="LoginControl"><a href="{xen:link login}" class="<xen:if is="@xb_login_overlay OR @xb_alt_login">OverlayTrigger </xen:if>concealed element">({xen:phrase log_in_or_sign_up_to_post})</a></label>
  4. Russ

    Russ Well-Known Member

    We do it on our site, in support tickets it's "Create new ticket" others it's the regular:

    template: forum_view
    {xen:phrase post_new_thread}
    Replace with:
    <xen:if is="{$forum.node_id} == 2">Create new ticket<xen:else />{xen:phrase post_new_thread}</xen:if>
    Do it on both instances of the {xen:phrase post_new_thread} **
    Zynektic, rafass, DaveL and 1 other person like this.
  5. DaveL

    DaveL Well-Known Member

    Thanks Russ, that looks a lot easier and tidier!
  6. clove28

    clove28 Active Member

    Hi Russ,

    How to make this change for all the forums? Thanks!
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Edit the post_new_thread phrase text.
    clove28 likes this.
  8. Rob

    Rob Well-Known Member

    Donny likes this.
  9. Donny

    Donny Active Member

Share This Page