[share] How to modify the $view_parameters valus in the template.

Author Message

david lee

Monday 12 July 2010 12:10:24 am

1. You have to install the swark extension.

 

 

2. Below I want to change the $view_parameters.offset to 10 in the template.

{set $view_parameters = $view_parameters|set_array_element("offset", 10)}

Nicolas Pastorino

Monday 12 July 2010 12:22:56 am

Thanks for sharing David. Indeed, the set_array_element operator is very useful, share.ez.no is using it in many places!

Cheers

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

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 30 2025 00:45:57
Script start
Timing: Jan 30 2025 00:45:57
Module start 'layout'
Timing: Jan 30 2025 00:45:57
Module start 'content'
Timing: Jan 30 2025 00:45:57
Module end 'content'
Timing: Jan 30 2025 00:45:57
Script end

Main resources:

Total runtime0.0369 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.0081 588.3906151.2422
Module start 'layout' 0.00810.0036 739.632836.7109
Module start 'content' 0.01170.0230 776.343890.0938
Module end 'content' 0.03470.0022 866.437529.9922
Script end 0.0369  896.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00338.8602140.0002
Check MTime0.00113.0336140.0001
Mysql Total
Database connection0.00133.465510.0013
Mysqli_queries0.00308.011430.0010
Looping result0.00000.056810.0000
Template Total0.00154.110.0015
Template load0.00113.024010.0011
Template processing0.00041.028210.0004
Override
Cache load0.00071.976410.0007
General
dbfile0.011130.063480.0014
String conversion0.00000.019440.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