how to show a variable in an other template?

Author Message

ZRIBI Anoir

Tuesday 30 March 2010 7:04:25 am

hi everybody;

i have 2 templates in:

/design/my_site/override/templates/template1.tpl

/design/my_site/override/templates/template2.tpl

i define my var in template1.tpl, i want to show it in template2.tpl.

please help.

thank you.

Guillaume Kempfer

Wednesday 31 March 2010 1:25:05 am

Does your template1.tpl call your template2.tpl ?

In this case you can pass variable to template2.tpl when you call it.
An an example if template2.tpl is a view line :

{node_view_gui content_node=$mynode view='line' myvar='foo' myvar2='bar'}

You can do the same way with a template include

{include uri="design:template2.tpl" myvar='foo' myvar2='bar'}

ZRIBI Anoir

Wednesday 31 March 2010 6:18:12 am

hi :)

no the template1.tpl call not the second template.

thank you for help.

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 10:24:59
Script start
Timing: Jan 18 2025 10:24:59
Module start 'layout'
Timing: Jan 18 2025 10:24:59
Module start 'content'
Timing: Jan 18 2025 10:24:59
Module end 'content'
Timing: Jan 18 2025 10:24:59
Script end

Main resources:

Total runtime0.8485 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 594.8047152.6406
Module start 'layout' 0.00530.0036 747.445339.4766
Module start 'content' 0.00890.8381 786.9219502.4922
Module end 'content' 0.84700.0014 1,289.41418.1250
Script end 0.8484  1,297.5391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3994160.0002
Check MTime0.00140.1639160.0001
Mysql Total
Database connection0.00090.106610.0009
Mysqli_queries0.796793.8950570.0140
Looping result0.00060.0691550.0000
Template Total0.812095.720.4060
Template load0.00230.271720.0012
Template processing0.809795.430820.4049
Template load and register function0.00010.011110.0001
states
state_id_array0.00110.130210.0011
state_identifier_array0.00170.203620.0009
Override
Cache load0.00190.2293230.0001
Sytem overhead
Fetch class attribute can translate value0.00090.101920.0004
Fetch class attribute name0.00170.203740.0004
XML
Image XML parsing0.00060.067120.0003
class_abstraction
Instantiating content class attribute0.00000.001350.0000
General
dbfile0.00080.0913150.0001
String conversion0.00000.001040.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs