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

XF 1.1 Display part of notice only on single page

Gladius

Well-known member
#1
What would be the best/easiest way of making a part of a global notice show only on forumhome (whatever the XF equivalent is called).

Basically, I've got a two-part notice text. 1st part shows on all pages, but I want the second part to only show on the main forum listing page.

Thanks!
 

Brogan

XenForo moderator
Staff member
#2
Create two notices.

Show the first one on all pages.
Show the second one on the forum_list template only.
 

Jake Bunce

XenForo moderator
Staff member
#4
Admin CP -> Appearance -> Templates -> EXTRA.css

Add this code:

Code:
.indexOnly
{
	display: none;
}

.forum_list .indexOnly
{
	display: block;
}
Then edit your notice and surround the conditional content with a div:

Code:
<div class="indexOnly">

</div>
 

Gladius

Well-known member
#5
Thanks, that works nicely on the user level, but the problem is that the text and links still remain crawlable, just hidden from sight. This is an ad I'm inserting and it must not appear on any other page except the main one. So I need to hide it from sight as well as make sure that the ad code does not remain visible to search engines. Is there a way around this?