I am using the following hook to run ads on my site: hook:ad_below_bottom_breadcrumb and using the following expression to show the ad only to unresitered users: Code: XenForo_Template_Helper_Core::callHelper('ismemberof', array($visitor,1)) My question is: Is there a way to restrict the widget only to certain templates? I want it to load only for the 'thread pages' and not on 'profile pages' or 404 error pages for instance. Thank you.
Hi, For that hook position, you can use something like this PHP: XenForo_Template_Helper_Core::callHelper('ismemberof', array($visitor,1))AND in_array($contentTemplate, array('thread_view', 'account_wrapper'))
Just wanted to add to the original question. Is it possible to not display the widget on certain threads using the 'thread ID'? Example, let's say I do not want the widget to appear on the following threads: sitename.com/threads/post-title.50 sitename.com/threads/another-post-title.467 How can I alter the above code to achieve this? Thank you!
xfrocks @planetzu If you use "thread_view" position, you can use this expression to prevent the widget from showing up PHP: !in_array($thread['thread_id'], array(50, 467))