Forums / Developer / Change session variables in templates

Change session variables in templates

Author Message

Markus Bader

Monday 30 July 2007 4:26:20 am

Hello everyone!

Is there a way to change session variables within templates; without php code?

Thanks a lot!

Markus

André R.

Monday 30 July 2007 5:17:47 am

Take a look in the contributions area.

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

Markus Bader

Monday 30 July 2007 6:36:18 am

This works fine: http://ez.no/community/contribs/template_plugins/template_session_functionality

Thanks a lot!

//edit: Every session variable you creat with this extension has a "tpl_" prefix. So you have to change the php code of the extension if you want to overwrite standard session variables. Fortunately, this is open source ;).

eZ debug

Timing: Jan 18 2025 21:14:03
Script start
Timing: Jan 18 2025 21:14:03
Module start 'content'
Timing: Jan 18 2025 21:14:04
Module end 'content'
Timing: Jan 18 2025 21:14:04
Script end

Main resources:

Total runtime0.9241 sec
Peak memory usage4,096.0000 KB
Database Queries58

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 588.8516180.8281
Module start 'content' 0.00730.9114 769.6797535.5781
Module end 'content' 0.91870.0054 1,305.257842.2578
Script end 0.9241  1,347.5156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3278140.0002
Check MTime0.00130.1447140.0001
Mysql Total
Database connection0.00090.095410.0009
Mysqli_queries0.884795.7280580.0153
Looping result0.00050.0564560.0000
Template Total0.893296.620.4466
Template load0.00210.229420.0011
Template processing0.891096.416320.4455
Template load and register function0.00020.026710.0002
states
state_id_array0.00130.142610.0013
state_identifier_array0.00070.074720.0003
Override
Cache load0.00170.1881140.0001
Sytem overhead
Fetch class attribute can translate value0.00060.069720.0003
Fetch class attribute name0.00130.135740.0003
XML
Image XML parsing0.00060.064520.0003
class_abstraction
Instantiating content class attribute0.00000.001140.0000
General
dbfile0.00160.1729190.0001
String conversion0.00000.001130.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs