XF 2.0 Unable to find $template in advertise

I am trying to create a sidebar add at thread_view only and I have done following:

1. Created a new ad under admin.php?advertising
2. Selected position - "Container sidebar: Above"
3. in HTML added following html
<xf:if is="$template == 'thread_view'">
Sidebar For Ads On Thread
</xf:if>
But $template is not available here I have tried to dump here { dump($template) } but it is giving me "null"

So Could anybody let me know how to display a ad on thread_view only?
 
Add this to the ad unit:
Code:
{{ dump(vars()) }}

That should help with identifying the params available.
 
Add this to the ad unit:
Code:
{{ dump(vars()) }}

That should help with identifying the params available.
Thank you for the suggestion.. but still unable to get the value of template variable from __globals .
When I am trying to print value using {{ dump($__globals['template']) }} , it is giving me error:

Could you take a look into the attached screenshot and if you can let me know how to get that value?
 

Attachments

  • Selection_237.webp
    Selection_237.webp
    40.7 KB · Views: 33
  • Selection_238.webp
    Selection_238.webp
    35.6 KB · Views: 33
Top Bottom