Forums / Extensions / ezscript loadorder and template question

ezscript loadorder and template question

Author Message

Lars Eirik R

Tuesday 01 March 2011 4:27:59 am

Hi.

We have experienced that ezscript_require(array(file,file,file) is not work if it appears before the following statement in our override template

{set scope=global persistent_variable=hash('left_menu', false(),
'extra_menu', false(),
'show_path', false())}

If i move the ezscript_require below the persisten_variable setting it works fine..

Is this a bug or something i should understand?

Also how can we influence the order of which the javascripts are loaded? We currently need to disable the packer feature to have our dependent libraries work successfully? Any thing i can do to control the order of these included javascripts when adding into the ezscript_require ordering?

André R.

Tuesday 01 March 2011 5:25:33 am

persistent_variable is used internally in ezscript* ezcss* functions to be able to persist variables from node view if page is cached.

The line you refer to clears the whole value. You can use ezpagedata_set( string $key, mixed $value ) / ezpagedata_append( string $key, mixed $value ) as provided by ezwebin instead, they will not overwrite the whole variable but instead threat it as a hash.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

eZ debug

Timing: Jan 29 2025 13:43:53
Script start
Timing: Jan 29 2025 13:43:53
Module start 'content'
Timing: Jan 29 2025 13:43:53
Module end 'content'
Timing: Jan 29 2025 13:43:53
Script end

Main resources:

Total runtime0.0132 sec
Peak memory usage2,048.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.2656180.8203
Module start 'content' 0.00560.0038 769.085993.9453
Module end 'content' 0.00940.0037 863.031370.6875
Script end 0.0131  933.7188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002015.2834120.0002
Check MTime0.00097.0924120.0001
Mysql Total
Database connection0.00107.544910.0010
Mysqli_queries0.002720.640340.0007
Looping result0.00000.090520.0000
Template Total0.003526.410.0035
Template load0.00086.111610.0008
Template processing0.002720.222210.0027
Override
Cache load0.00064.388710.0006
General
dbfile0.00021.8260100.0000
String conversion0.00000.029030.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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