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

Add "?forum_id" to thread links

Discussion in 'XenForo Development Discussions' started by Marcus, Oct 23, 2012.

  1. Marcus

    Marcus Well-Known Member

  2. James

    James Well-Known Member

    You'd have to edit the route and add it as a parameter at build time. I can't give you an example right now because I'm mobile.
    Marcus likes this.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Need to extend this:


    Thread records contain the node_id, though it might not be safe to assume the node_id is available. Might have to do an isset() check on that before adding it to the link.
    Marcus and James like this.
  4. Marcus

    Marcus Well-Known Member

    I added $thread['myforumId'] = 5 to ControllerPublic_Thread::actionIndex and I can see this variable on XenForo_Route_Prefix_Threads::buildLink with $extraParams['test'] = var_dump($data);

    array(35) {
    ["thread_id"]=> int(2)
    ["node_id"]=> int(2)
    ["title"]=> string(4) "testtitle"
    ["myforumId"]=> int(5)} 
    This adds the title to the url: $extraParams['test'] = $data['title']; But $extraParams['test2'] = $data['myforumId']; does not work. Do you have any idea why my variable is displayed in the dump:$data, but it does not work here? Thank you so much.
  5. Marcus

    Marcus Well-Known Member

    ok I had solved it by add the parameter in ControllerPublic_Forum::actionIndex.

Share This Page