Chromaniac Well-known member Licensed customer Dec 14, 2017 #1 I was using a template modification on XF1.x. Looking for a similar code for XF2. Thanks! Sigh. Just realized this should be in customization section. Sorry.
I was using a template modification on XF1.x. Looking for a similar code for XF2. Thanks! Sigh. Just realized this should be in customization section. Sorry.
Solution SyTry Jan 5, 2019 Hello, In your thread_view template, find : HTML: <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...
Hello, In your thread_view template, find : HTML: <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...
SyTry Well-known member Licensed customer Jan 5, 2019 #2 Hello, In your thread_view template, find : HTML: <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 : HTML: <xf:if is="$thread.canReply()"> <xf:button href="{{ link('forums/create-thread', $forum) }}" class="button--link" icon="write">{{ phrase('post_thread') }}</xf:button> </xf:if> Screen : Regards, SyTry Upvote 1 Downvote Solution
Hello, In your thread_view template, find : HTML: <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 : HTML: <xf:if is="$thread.canReply()"> <xf:button href="{{ link('forums/create-thread', $forum) }}" class="button--link" icon="write">{{ phrase('post_thread') }}</xf:button> </xf:if> Screen : Regards, SyTry
Chromaniac Well-known member Licensed customer Jan 5, 2019 #3 hah! worked. thanks a lot. Upvote 0 Downvote
Andro Well-known member Licensed customer Dec 10, 2019 #4 Updated code for XF 2.1 incase anyone looking for it, uses $forum.canCreateThread() check instead of $thread.canReply() and forums/post-thread link instead of old forums/create-thread. Replace SyTry's provided code with below: HTML: <xf:if is="$forum.canCreateThread()"> <xf:button href="{{ link('forums/post-thread', $forum) }}" class="button--link" icon="write">{{ phrase('post_thread') }}</xf:button> </xf:if> Hit save and you are good to go. Upvote 1 Downvote
Updated code for XF 2.1 incase anyone looking for it, uses $forum.canCreateThread() check instead of $thread.canReply() and forums/post-thread link instead of old forums/create-thread. Replace SyTry's provided code with below: HTML: <xf:if is="$forum.canCreateThread()"> <xf:button href="{{ link('forums/post-thread', $forum) }}" class="button--link" icon="write">{{ phrase('post_thread') }}</xf:button> </xf:if> Hit save and you are good to go.
Chromaniac Well-known member Licensed customer Mar 25, 2020 #6 it's still working on my board. could it be a caching issue? maybe the changes made in the templates is not yet visible on the frontend? Upvote 0 Downvote
it's still working on my board. could it be a caching issue? maybe the changes made in the templates is not yet visible on the frontend?