PDA

View Full Version : If show Adverts query


vwt4forum
09-10-2008, 09:30 PM
Hi there, i have successfully installed GAB on our forum, and i am looking to add an if to hide any formatting i.e. padding i am putting around my scripts blocks.

To look something like this:

<if condition="$show['gabAdverts']">
<div style="padding-bottom: 10px;">$GAB_ads[0]</div>
</if>

Please help!

Cheers

Jim

Morgan
09-11-2008, 04:58 PM
In the GAB ACP Billboards section, set Wrapper to no to remove the GAB wrapper from the ads in that billboard, and then you can use whatever HTML you want to wrap the $GAB_ads[X] variables from that billboard. Either style="padding-bottom: 10px;" or style="margin-bottom: 10px;" could be used to add 10 pixels to the bottom depending on the HTML you use.

vwt4forum
09-11-2008, 10:01 PM
Thanks Morgan, but what i am after is an IF statement to surround the $GAB_ads[X] so that if there if a billboard is not set to be included in a certain script script such and "index" then it won't include the the formatting.

Or maybe a location where i could edit the script so that all banners appeared in a block which I could assign a class.

Looking into the 'product-gab.xml' i can see the template nodes which define how the html i am interested in is output

"GAB_item_flash"
"GAB_item_image"

I can simply edit these myself however does this invalid your support or affect future updates?

If it would; this is why it would be great to have an if statement to be used around the billboards, it would also keep it more flexible and object oriented .

Eagerly awaiting a reply! :):)

Cheers

Jim

Morgan
09-13-2008, 04:46 AM
Try using $GAB_ads[0] in the template conditional. If $GAB_ads[0] is set, then style as wanted; otherwise no style should appear:

<if condition="$GAB_ads[0]">
<div style="padding-bottom: 10px;">$GAB_ads[0]</div>
</if>

vwt4forum
09-13-2008, 04:07 PM
Thanks morgan that did the trick

Cheers

Jim

vwt4forum
09-18-2008, 08:52 PM
hi Morgan,

I am soon to roll out the advertising scheme across our forum; there will be 2 types of advertisments:

Network ads, for guests and non-paid members
Targeted ads, for all members, these will specifically target signed up members with special exclusive offers, more than just your run of the mill advert.


The problem i have is that the standard GAB only allows for a global usergroup viewing settings, rather than billboard specific.

The way around this for me is to use template conditionals for userID. It might be a suggestion for a future upgrade.