XF 1.1 How to exclude content from home page


Active member
I'm using the ad_above_content template to display a 728x90 banner above my threads and forum lists. Unfortunately, this also places the banner on the home page just above the forum list and displays the banner over the sidebar.

(I do think that this needs to be addressed. Perhaps another ad template needs to be created because on all pages the area above the content spans the full length of the page whereas the home page has the sidebar. )

I know that this can be done using if statements but I'm unsure as to how to call the home page template.

Does anyone know the if statement that I need to use in order to exclude content that is placed there with the ad_above_content template.



Active member
Thanks Brogan. Worked a charm.

Though I noticed some other pages such as the member list that have a sidebar too. Is there a way to only show the ad on pages with no sidebar.


XenForo moderator
Staff member
There isn't a way of automatically excluding it from all pages with a sidebar as there is no common reference; you will need to add each template into the conditional statement.


Active member
ok. I can just add a template to the if statement whenever I find one :)

I tried this but it didn't work. Any ideas what I did wrong?

<xen:if is="{$contentTemplate} != 'forum_list' OR {$contentTemplate} != 'member_list'">


Well-known member
Try this (hope my syntax is correct)

<xen:if is="!({$contentTemplate} == 'forum_list' OR {$contentTemplate} == 'member_list')">


Active member
<xen:if is="!{$sidebar}">
That may work, depending on the template you're trying it in.
That worked great Mike. I've replaced Brogans suggestion (which also worked) with your code as it's simpler and will ensure that the ad will never be posted on any page with a sidebar.