1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 How to add a script only to index page?

Discussion in 'XenForo Questions and Support' started by NeoCHI, May 29, 2016.

  1. NeoCHI

    NeoCHI Active Member

    Just as the title says. I'd like to add a script but only have it load for the forum_index page. How do I do this?
  2. rainmotorsports

    rainmotorsports Well-Known Member

    Might be another way but there is one sure fire way. You can do a template check to see what controller is in play and display only on that.

    I use this for xenporta:
    <xen:if is="{$controllerName} == 'EWRporta_ControllerPublic_Portal'"></xen:if>
    Off the top of my head not sure which controller runs with the forum index but figure that out and you should be golden.
  3. Mike

    Mike XenForo Developer Staff Member

    Can you simply add it to the forum_list template?

Share This Page