XF 2.0 Post reply button

Bombardier

Active member
My users are requesting a 'Post Reply' button at the top right of the thread pages, is there a way of achieving this ?

Thanks in advance :)
 

SyTry

Well-known member
Ok, in your thread_view template, find :
HTML:
<xf:button class="button--link menuTrigger" data-xf-click="menu" aria-expanded="false" aria-haspopup="true" title="{{ phrase('more_options') }}">&#8226;&#8226;&#8226;</xf:button>
Replace by :
HTML:
<xf:if is="$thread.canReply()">
    <xf:button href="{{ link('threads/reply', $thread) }}" data-xf-click="overlay" class="button--link" icon="write">{{ phrase('reply') }}</xf:button>
</xf:if>
<xf:button class="button--link menuTrigger" data-xf-click="menu" aria-expanded="false" aria-haspopup="true" title="{{ phrase('more_options') }}">&#8226;&#8226;&#8226;</xf:button>
Screen :
192033

Remove data-xf-click="overlay" if you don't want an overlay ! ;)

Regards, SyTry
 

Bombardier

Active member
After checking with registered users rather than my admin account it would seem the reply button does not show unless admin or mod?
I have checked group permissions but cannot see what I may need to change there, any ideas ? @SyTry
 

SyTry

Well-known member
After checking with registered users rather than my admin account it would seem the reply button does not show unless admin or mod?
I have checked group permissions but cannot see what I may need to change there, any ideas ? @SyTry
For me it work, try this <xf:if is="$xf.visitor.user_id"> instead of <xf:if is="$thread.canReply()"> ! ;)
 

Bombardier

Active member
very confusing, works for admin & mod accounts but not for registered users?
I have been through all the permissions and all is well there. If you have any other suggestions they will be gratefully received :)
 

SyTry

Well-known member
very confusing, works for admin & mod accounts but not for registered users?
I have been through all the permissions and all is well there. If you have any other suggestions they will be gratefully received :)
Do your members have the button to answer here :
192051

If they don't have it, it's a problem with permissions ;)
 

OperaManiac

Well-known member
this is offtopic but kind of related. there was a bit of code that added a new thread button on thread pages. it was for xf1. i haven't found a similar solution for xf2. since the code would go in the same template... would it be possible for you to provide that as well? @SyTry basically a new thread button (for starting a new thread in same forum) that would appear at the same place where you are adding the reply button in #5

thanks!

this is the code for xf1:
 
Last edited:

SyTry

Well-known member
Yes they can reply to threads in the normal way
Oh my bad, try this. Find (thread_view) :
Code:
                    <xf:if is="$thread.canWatch()">
                        <xf:button href="{{ link('threads/watch', $thread) }}" class="button--link"
                            data-xf-click="switch-overlay"
                            data-sk-watch="{{ phrase('watch') }}"
                            data-sk-unwatch="{{ phrase('unwatch') }}">
                            <xf:if is="{$thread.Watch.{$xf.visitor.user_id}}">
                                {{ phrase('unwatch') }}
                            <xf:else />
                                {{ phrase('watch') }}
                            </xf:if>
                        </xf:button>
                    </xf:if>
Add this after :
Code:
                    <xf:if is="$thread.canReply()">
                        <xf:button href="{{ link('threads/reply', $thread) }}" data-xf-click="overlay" class="button--link" icon="write">{{ phrase('reply') }}</xf:button>
                    </xf:if>
:)

EDIT : @OperaManiac I will take a look yes !
 

SyTry

Well-known member
So I keep the code the same as specified before but add this in addition
No, we're going to pretend you never had a solution so just follow this answer :

It should be good because the first code was in the moderation part ! :ROFLMAO:
 
Top