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

XF 1.2 Hiding elements depending on page name

Discussion in 'Styling and Customization Questions' started by onlineuk, Oct 4, 2013.

  1. onlineuk

    onlineuk New Member

    Hi all,

    I currently have a welcome box on my forum that shows for anyone that is a visitor, once logged in it disappears.

    Is there also a way to get this so that it doesn't show on particular pages (in this example, contact and advertise).

    Many thanks

  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. onlineuk

    onlineuk New Member

    Thanks for the speedy reply @Brogan, I've given it a go, done a little more research before hassling but am struggling to implement this.

    If, when I'm on the pages in question and my domain in the address bar is as follows:




    would that still require the array to be 'contact-us','advertise' ?
  4. Brogan

    Brogan XenForo Moderator Staff Member

    The FAQ in my signature explains how to identify the template name.
  5. onlineuk

    onlineuk New Member

    Excellent thanks @Brogan, worked a treat.
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Page nodes all share the same contentTemplate.

    This alternative condition may be desirable if you wish to exclude some but not all page nodes:

    <xen:if is="!in_array({$requestPaths.requestUri}, array('/pages/advertise/', '/pages/contact-us/')">
    Matching the requestUri is more precise than using the contentTemplate, but it is also somewhat crude.

Share This Page