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

display threads on page element like forum list

Discussion in 'XenForo Development Discussions' started by localhost8080, Mar 8, 2015.

  1. localhost8080

    localhost8080 Well-Known Member


    I've setup a page element with a callback class.

    There, I do a custom sql to search for threads.

    I have a threadIds array with all threads I need. Also I have the threads in memory by using

    $threads = $threadModel->getThreadsByIds(
                    'join' =>
                        XenForo_Model_Thread::FETCH_FORUM |
                    'permissionCombinationId' => $visitor['permission_combination_id']
    Now, I want to display them like a forum list.

    Someone can tell me what to do now?

    Thank you and best regards.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Do you mean you want to display them like the thread list template/view?

    If so, copy the HTML into your page node content, ensuring the required variables are passed to it from your callback.
  3. localhost8080

    localhost8080 Well-Known Member

    yes. I have this:

    <xen:set var="$threads"><xen:callback class="My_ThreadHelper" method="getThreads" /></xen:set>
    {xen:helper dump, $threads}
    <br /><center>
    <div class="discussionList section sectionMain">
        <xen:include template="thread_list" />
    if I vardump the return value within my callback method, I got the right content.


    {xen:helper dump, $threads}
    I got

    string(5) "Array"

    and I got some errors because "$threads" is not an array but a string with the word "Array"
  4. localhost8080

    localhost8080 Well-Known Member

    got it. thx.

Share This Page