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 29 2025 10:19:01
Script start
Timing: Jan 29 2025 10:19:01
Module start 'layout'
Timing: Jan 29 2025 10:19:01
Module start 'content'
Timing: Jan 29 2025 10:19:01
Module end 'content'
Timing: Jan 29 2025 10:19:01
Script end

Main resources:

Total runtime0.0201 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 589.4219151.2266
Module start 'layout' 0.00650.0041 740.648436.6875
Module start 'content' 0.01060.0074 777.335991.2500
Module end 'content' 0.01800.0021 868.585933.9766
Script end 0.0201  902.5625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002512.4540140.0002
Check MTime0.00115.3333140.0001
Mysql Total
Database connection0.00157.580210.0015
Mysqli_queries0.003818.781030.0013
Looping result0.00000.113710.0000
Template Total0.00167.810.0016
Template load0.00125.852110.0012
Template processing0.00041.908110.0004
Override
Cache load0.00073.701210.0007
General
dbfile0.00178.355980.0002
String conversion0.00000.029640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs