Post New Thread From XF Page

LPH

Well-known member
I set up a page with embedded forum threads showing for a particular node. This works great. Now I want to add a post_new_thread button.

This is in the page, but the button is not rendering. The code comes from the forum_view template.

Code:
<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>
</xen:if>
 
<xen:require css="discussion_list.css" />
<div class="discussionList">
{xen:raw $forum}
</div>

Any suggestions on getting the post to thread button?
 
This will show the button but once I wrap it with anything then it will not render. Obviously this is being shown to members and nonmembers alike. Permissions don't allow non-registered members to post but ... would be nice to hide it.

Update: Sometimes the obvious will get ya :)

I didn't have the code inside the baseHtml

Code:
<div class="messageText ugc baseHtml">

This works fine.

Code:
<xen:if is="{$visitor.user_id}">
<a href="{xen:link '/community/forums/research-notes-support.233/create-thread'}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a><br /><br />
</xen:if>
 
Back
Top Bottom