1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Post New Thread From XF Page

Discussion in 'General PHP and MySQL Discussions' started by LPH, Jan 14, 2013.

  1. LPH

    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.

    <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:require css="discussion_list.css" />
    <div class="discussionList">
    {xen:raw $forum}
    Any suggestions on getting the post to thread button?
  2. LPH

    LPH Well-Known Member

    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

    <div class="messageText ugc baseHtml">
    This works fine.

    <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 />

Share This Page