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.
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);
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.