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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:20:36
Script start
Timing: Jan 18 2025 19:20:36
Module start 'layout'
Timing: Jan 18 2025 19:20:36
Module start 'content'
Timing: Jan 18 2025 19:20:37
Module end 'content'
Timing: Jan 18 2025 19:20:37
Script end

Main resources:

Total runtime0.9396 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 589.0391152.6250
Module start 'layout' 0.00540.0030 741.664139.4453
Module start 'content' 0.00840.9298 781.1094532.9375
Module end 'content' 0.93820.0013 1,314.046912.1719
Script end 0.9395  1,326.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3506160.0002
Check MTime0.00130.1430160.0001
Mysql Total
Database connection0.00110.112910.0011
Mysqli_queries0.884794.1618540.0164
Looping result0.00160.1677520.0000
Template Total0.888894.620.4444
Template load0.00270.282920.0013
Template processing0.886194.312320.4431
Template load and register function0.00010.012010.0001
states
state_id_array0.00480.508510.0048
state_identifier_array0.00370.397120.0019
Override
Cache load0.00210.2227220.0001
Sytem overhead
Fetch class attribute can translate value0.00090.100320.0005
Fetch class attribute name0.00160.168640.0004
XML
Image XML parsing0.00240.253220.0012
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00230.2473220.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs