detect "parent" object in embeded object template

Author Message

Marko Žmak

Thursday 28 January 2010 4:11:54 am

I have an object (object A) embeded in OE field of another object (object B), and I have a template override for this embeded object A. How can I detect in this template what is the the object_id of the object B?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Bertrand Dunogier

Thursday 28 January 2010 7:25:22 am

You can get a variable from the parent's template namespace using the # sign. If the variable you're looking for is $object_id, this is what it would look like:

$#object_id

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

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 23:50:34
Script start
Timing: Jan 29 2025 23:50:34
Module start 'layout'
Timing: Jan 29 2025 23:50:34
Module start 'content'
Timing: Jan 29 2025 23:50:34
Module end 'content'
Timing: Jan 29 2025 23:50:34
Script end

Main resources:

Total runtime0.0142 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.0052 588.2656151.2266
Module start 'layout' 0.00530.0032 739.492236.6953
Module start 'content' 0.00850.0044 776.187590.2188
Module end 'content' 0.01290.0013 866.406329.9922
Script end 0.0142  896.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002517.7689140.0002
Check MTime0.00118.0310140.0001
Mysql Total
Database connection0.00053.720110.0005
Mysqli_queries0.003020.866530.0010
Looping result0.00000.098710.0000
Template Total0.00107.310.0010
Template load0.00085.832110.0008
Template processing0.00021.382310.0002
Override
Cache load0.00064.190410.0006
General
dbfile0.00075.124280.0001
String conversion0.00000.055240.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.0002 secs