Xen:If Conditional For Threads and Coversations

I tried Googling and searching for this, but couldn't find anything. I have a template I'm including with an addon that loads some JS, but I want to only load the JS when viewing thread and conversation pages (it has no function unless on those pages, so I figure the extraneous loads should be removed).
HTML:
<xen:if is="thread or conversation">
<xen:require js="path/to/my/file.js" />
</xen:if>
I'm guessing the check has to be for the templates conversation_list and thread_list maybe, but I'm not sure of the syntax. Thanks in advance for any help!
 
I think you're missing something. It would be more like:

Code:
<xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Thread' OR {$controllerName} == 'XenForo_ControllerPublic_Conversation'">
<xen:require js="path/to/my/file.js" />
</xen:if>

There's also $contentTemplate and $controllerAction and a few other useful ones too. But I believe the above should do it.
 
Thanks ragtek :o

Don't know what I was thinking there!

I updated my original post to avoid confusion for anyone who may stumble upon it in the future.
 
Top Bottom