• 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

#1
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

Andy
 
#3
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:

domain.com/pages/advertise

and

domain.com/pages/contact-us

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

Jake Bunce

XenForo moderator
Staff member
#6
Page nodes all share the same contentTemplate.

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

Code:
<xen:if is="!in_array({$requestPaths.requestUri}, array('/pages/advertise/', '/pages/contact-us/')">

</xen:if>
Matching the requestUri is more precise than using the contentTemplate, but it is also somewhat crude.