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

Pulling $thread data into a new template

Discussion in 'XenForo Development Discussions' started by Gossamer, Feb 14, 2015.

  1. Gossamer

    Gossamer Active Member

    Hello! So, I've extended ControllerPublic Thread to create a new action. My intention is to create a one-click action to easily go through a number of steps we undergo on my forum when accepting new applications.

    Right now, I just have the action go to an overlay with placeholder information. However, I'm trying to pull in {$thread.username} and {$thread.title}, but I'm not getting any thread data. I feel like I must be missing something really silly, because I've definitely done this in the past. I can't figure out what I'm doing wrong though.

    Here is my Extended ControllerPublic_Thread:
     public function actionAppAccept()
    $threadId $this->_input->filterSingle('id'XenForo_Input::UINT);
    $threadModel $this->_getThreadModel();
    $thread $threadModel->getThreadById($threadId);
    $viewParams = array(
    'thread' => $thread
    And here is my rps_thread_accept template:
    <xen:title>{xen:phrase rps_accept_character}</xen:title>

    form action="{xen:link 'thread/appAccept', $thread}" method="post" class="xenForm formOverlay" id="accept-app">
    Thread Title: {$thread.title}<br>
    Thread Starter: {$thread.username}
    p>Field for setting fandom
    <p>Field for custom reply message
    {xen:helper dump$thread}
    {xen:helper dump, $thread} just results in bool(false)
  2. Gossamer

    Gossamer Active Member

    Oh, figured it out! I was using 'id' instead of 'thread_id'. It's always the simple ones. :p
    Valhalla likes this.

Share This Page