Shuffle works only with fetch blocks?

Author Message

Denitsa M.

Tuesday 09 August 2011 3:28:15 am

Hello,

I need a manual adding items block, in which to put N items, show X of them (X < N) with shuffling. I want to use the shuffle ability of ezflow, but it seems not to be working in manual block. So I assume shuffle is working only when block uses fetch from settings, is that correct, or there is any way to use the shuffle with manual blocks too and set the valid_nodes as a random array of X items out of N?

Iguana IT - http://www.iguanait.com

Felix Laate

Tuesday 09 August 2011 4:41:59 am

You could use a shuffle operator. Add e.g. the http://projects.ez.no/swark_for_ez_publish_4 extension, and then use the shuffle operator to randomize the order of the $valid_nodes array.

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Denitsa M.

Tuesday 09 August 2011 4:56:14 am

Thank you for your reply, but my meaning is exactly not to use any operator in templates. It is pointless system to return all N items into the valid_nodes array, when it can return only X items; imagine if N is 100 and X is 3, then this is just a waste of resources. If it was up to an operator usage, you do not even need an extra extension to do this with template code.

Iguana IT - http://www.iguanait.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 00:47:33
Script start
Timing: Jan 18 2025 00:47:33
Module start 'layout'
Timing: Jan 18 2025 00:47:33
Module start 'content'
Timing: Jan 18 2025 00:47:33
Module end 'content'
Timing: Jan 18 2025 00:47:33
Script end

Main resources:

Total runtime0.2078 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 589.1797152.6406
Module start 'layout' 0.00470.0087 741.820339.4844
Module start 'content' 0.01340.1931 781.3047530.9141
Module end 'content' 0.20650.0012 1,312.218812.1328
Script end 0.2077  1,324.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.6745160.0002
Check MTime0.00130.6180160.0001
Mysql Total
Database connection0.00060.309510.0006
Mysqli_queries0.163878.8498600.0027
Looping result0.00060.2806580.0000
Template Total0.172182.920.0861
Template load0.00221.054220.0011
Template processing0.169981.791020.0850
Template load and register function0.00020.110210.0002
states
state_id_array0.00040.187710.0004
state_identifier_array0.00080.407220.0004
Override
Cache load0.00180.8632110.0002
Sytem overhead
Fetch class attribute can translate value0.00060.267620.0003
Fetch class attribute name0.00110.533340.0003
XML
Image XML parsing0.00050.257520.0003
class_abstraction
Instantiating content class attribute0.00000.004440.0000
General
dbfile0.00080.3660160.0000
String conversion0.00000.003740.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0003 secs