onlineuk New member Oct 4, 2013 #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
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
P Paul B XenForo moderator Staff member Oct 4, 2013 #2 Use a conditional statement, in this case an array: http://xenforo.com/community/resources/conditional-statements.1604/ <xen:if is="!in_array({$contentTemplate}, array('contact', 'advertise'))" Upvote 0 Downvote
Use a conditional statement, in this case an array: http://xenforo.com/community/resources/conditional-statements.1604/ <xen:if is="!in_array({$contentTemplate}, array('contact', 'advertise'))"
onlineuk New member Oct 4, 2013 #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' ? Upvote 0 Downvote
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' ?
P Paul B XenForo moderator Staff member Oct 4, 2013 #4 The FAQ in my signature explains how to identify the template name. Upvote 0 Downvote
Jake Bunce Well-known member Oct 5, 2013 #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: Rich (BB 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. Upvote 0 Downvote
Page nodes all share the same contentTemplate. This alternative condition may be desirable if you wish to exclude some but not all page nodes: Rich (BB 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.