XF 2.2 Showing "Post Thread" Button for Guests

Tamasita

Member
Hello,I'm looking for a way to display the "Post Thread" button to guest users on my XenForo forum. Currently, only registered members can post, but I'd like guests to see the button (even if they can't actually post) to encourage registration.

I've tried editing the forum_view template, but when I remove the "if conditions," the link structure breaks for logged-in users. Any guidance on how to achieve this would be appreciated.Thank you.

Code:
<xf:pageaction if="$forum.canCreateThread() OR $forum.canCreateThreadPreReg()">
    <xf:button href="{{ link('forums/post-thread', $forum) }}" class="button--cta" icon="write" rel="nofollow">
        {{ phrase('post_thread') }}
    </xf:button>
</xf:pageaction>
 
Why don't you just implement this?

 
Why don't you just implement this?


Thank you for your reply. I am aware of that function, but it's not suitable for my website because the most important node where I want guests to see the "post thread" button relies heavily on attachments. Since guest accounts are unable to attach images and can only link them, it would not be a suitable option to use. I would just need the button, and when they click it, xenForo by default brings them to login/register first.
 
Since guest accounts are unable to attach images and can only link them, it would not be a suitable option to use.
My understanding is that option does need registration, it's just the draft post that can be done as a guest. They need to then register to complete the post. I don't use the function but I presume that they will then be able to add the attachment to the draft after registering.
 
Top Bottom