xF2 Template Modification Add 'Post Reply' & 'Post Thread' buttons to the top of thread view pages

uydudoktoru

Tanınmış Üye
Yönetici
Yönetici
This is just a simple template edit that will give your forum 'Post Reply' and 'Post Thread' buttons at the top of thread view pages.
  • Post Reply button will open an overlay where users can reply directly to the thread they're currently viewing.
  • Post Thread button will open an overlay where users can select a forum before creating a new thread.
Go to:
ACP --> Template --> thread_view and find:
PHP:
<xf:breadcrumb source="$forum.getBreadcrumbs()" />
Add this code directly below that line:
PHP:
<xf:pageaction>
    <xf:if is="$thread.canReply()">
            <xf:button href="{{ link('threads/reply', $thread) }}" data-xf-click="overlay" class="button--primary" icon="reply">
            {{ phrase('post_reply') }}
        </xf:button>
    </xf:if>
    <xf:if is="$xf.visitor.canCreateThread() OR $xf.visitor.canCreateThreadPreReg()">
        <xf:button href="{{ link('forums/create-thread') }}" class="button--primary" icon="write" overlay="true" rel="nofollow">
            {{ phrase('post_thread') }}
        </xf:button>
    </xf:if>
</xf:pageaction>
 
Geri
Yukarı