XF 1.5 How to get the Thread ID in the Ad templates?

XFuser

Active member
Hello,

How can we get the Thread ID in the Ad Templates?

We have tried several different variations of the thread id variable, but no variation is actually producing the thread id.

We dumped the $forum variable in the Ad Template and it dumps a lot of data but does not show the thread id. Dumping the $page and $thread variable resulted in NULL.

So how can we get the Thread ID in the Ad Templates?

Thank you.
 
XenForo renders content in 2 steps: content and container. They have different variables.

In thread view in content block you have $thread variable, in container because of that custom code you have $threadId variable. So if $threadId doesn't work, most likely ad is rendered with content instead of container, so try $thread.thread_id
That does not seem to work.

We have decided to use regex to extract the Thread ID directly from the URL as that is much easier and it works.

Thank you for your help.
 
Top Bottom