PDA

View Full Version : How to add rotation functionality for banner manager plugin


dino
05-28-2008, 03:22 PM
You can add similar functionality that exists in rotating headlines to banner manager plugin. That way your banners can make even more impressions and clicks!

To make banners rotate, you'll need to:

create new .tpl file (i.e. rotating_banners_z1.tpl) and put it in the {VIVVO_TEMPLATE}box/ directory. Paste code from banner manager plugin (i.e. <vte:load module="box_banners" search_zone_id="1" /> ) to that file.

edit {VIVVO_TEMPLATE}homepage/default.tpl (or any page you want to have rotating banners) and instead of your regular banner code

<vte:load module="box_banners" search_zone_id="1" />

you should put this code:

<div id="rotatingBanners_z1">
<vte:load module="box_banners" search_zone_id="1" />
</div>
<script type="text/javascript" language="javascript">
<!--
var rotation_z1=new Ajax.PeriodicalUpdater('rotatingBanners_z1', 'index.php?template_output=box/rotating_banners_z1', {frequency:10});
-->
</script>

In <script> tag, value 'index.php?template_output=box/rotating_banners_z1' tells Vivvo which file to return, so if your file name is different than 'rotating_banners_z1.tpl' you should change that value. Note that file name should be given WITHOUT extension. Also, {frequency:10} actually stands for interval (in seconds) between rotations.

In addition, if you have multiple zones, you'll have to repeat those steps for each one. Make sure that you change each 'z1' to corresponding z{zone number}.

simonow
07-19-2008, 04:52 PM
I love the idea, mine comes up with a sxytax error. Can you help?

AS

dino
07-21-2008, 08:23 AM
What's the error? Can you provide URL?

simonow
07-22-2008, 12:41 PM
The browser comes up with a javascript syntax error when I insert the script.

Doesn't seem to like the <!-- -->, but than when I remove this, nothing happens,,, but shows the banner not in rotaion.

dino
07-22-2008, 03:10 PM
What is the js error message? On what line is it reported?

simonow
07-22-2008, 10:18 PM
Follow this link to see the error.

http://ctrivereast.com

Thank for helping.

simonow
07-22-2008, 10:24 PM
This is it...

simonow
07-22-2008, 11:51 PM
This is the code I inserted...


<div id="rotatingBanners_z4">
<vte:load module="box_banners" search_zone_id="4" />
</div>
<script type="text/javascript" language="javascript">
<!--
var rotation_z4=new Ajax.PeriodicalUpdater('rotatingBanners_z4', 'index.php?template_output=box/rotating_banners_z4', {frequency:10});
-->
</script>

dino
07-23-2008, 08:24 AM
Try wrapping <vte:literal> around the <script> tag, like this:

<vte:literal>
<script type="text/javascript" language="javascript">
<!--
var rotation_z4=new Ajax.PeriodicalUpdater('rotatingBanners_z4', 'index.php?template_output=box/rotating_banners_z4', {frequency:10});
-->
</script>
</vte:literal>

simonow
07-23-2008, 11:29 AM
When I add the <vte:literal> </vte:literal>,,, the banner doesn't show at all.

Could it be the index.php?template_output=box/rotating_banners_z4'?

dino
07-23-2008, 01:32 PM
Hmm... on the addres you supplied the code looks like this:

var= rotation_z4 new Ajax.PeriodicalUpdater(...

Looks like equation mark is misplaced. The code should look like:

var rotation_z4 = new Ajax.PeriodicalUpdater(...

And, about the index.php?template_output=box/rotating_banners_z4, you can check if that template exists simply by pasting it into the address bar:

{VIVVO_URL}index.php?template_output=box/rotating_banners_z4

If the banner shows up, the template is ok.

simonow
07-23-2008, 02:41 PM
Ok It works,,, now takes about 4 minutes before it changes then 10 seconds changes than about 4 minutes.

Atleast it works,,, any more help?

Andrew