Forums / Setup & design / cycle through objects

cycle through objects

Author Message

Frode Slettum

Saturday 14 October 2006 1:31:43 pm

Hi

I want to make a template that cycles through all objects within a node. It's almost identical with the full image template. That template have the "previous" and "next" links that jumps to the next image. I want the same thing, only that I want the page to be automatically redirected to the next object within x seconds. When it comes to the last object, it skips to the first.

I took a look at the full image template and tried to modify it to fit my scenario, but I couldn't manage it to work. I'm not sure what I did wrong.

Any tips folks?

regards
Frode S

Marco Zinn

Sunday 15 October 2006 4:59:36 am

Hi,

i guess, you need to solve two issues:
1. Wrap-Around:
Loading the first image, after the last image ist shown. I think, that shouldn't be too hard, as the current template grays out the "next"-button, when you are at the last image; so you can re-use that code.

2. Auto-Forwarding after n seconds:
Actually, this is what most user (and customers) expect from a "slideshow". If you solve this, it should make its way into the ez distribution ;)
I'd try these things:
2a: Redirect the browser using a javascript, which waits n seconds and the overrides the location of the current window. This will load the next page. But it need JS.
2b: Have a look at the new eZpublish features, which allow a template to modify the HTTP headers, which are sent with the page. I _think_ you can achieve the loading of the next page with HTTP headers (redirect-to, including a delay). If this works, it would be better, as it does not rely on JS code, which is always a pain. Unfortunately, i didn't find a link for that feature right now, but i'm sure, i read about it somewhere ;)

Maybe this helps

Marco
http://www.hyperroad-design.com