PDA

View Full Version : Conditional question - how to make something NOT show up only on the main page?


styleforum
07-20-2007, 12:47 AM
I have a strip of ads that I have set up with conditionals so they change based on what forum you're viewing. I want a default set to show up on search results pages, but I think it would look cleaner to remove them completely from the main forum home view. I imagine I can enclose the whole section in an <if> statement that should do this, but I don't know what the if statement should be exactly.

Basically,

<IF [current template/page] !==[the main home page one]>
(ad stuff)
</if>

How would I write this properly?

Thanks.

Guest190829
07-20-2007, 12:52 AM
<if condition="THIS_SCRIPT != 'index'">

</if>

Michael Biddle
07-20-2007, 12:55 AM
Well depending on the script, put at bottom of navbar template like this:

<if condition="THIS_SCRIPT == 'defined page'">ad code here</if>

Where defined page you can find in the actual file itself

In attachments for example its:

define('THIS_SCRIPT', 'attachment');

So you would use

<if condition="THIS_SCRIPT == 'attachment'">ad code here</if>

Hope this helps

styleforum
07-20-2007, 01:04 AM
<if condition="THIS_SCRIPT != 'index'">

</if>

Sweet, that does it! Thanks!

Well depending on the script, put at bottom of navbar template like this:

<if condition="THIS_SCRIPT == 'defined page'">ad code here</if>

Where defined page you can find in the actual file itself

In attachments for example its:

define('THIS_SCRIPT', 'attachment');

So you would use

<if condition="THIS_SCRIPT == 'attachment'">ad code here</if>

Hope this helps

Thanks very much, this helps me for when I go back through and finish really pinning down which ads should be on which pages.

I appreciate the speedy responses!