how can a datatype know from which object is called?

Author Message

Alessandro Cipriani

Friday 04 June 2004 6:18:52 am

hi all
i've created my own datatype (the previous post is fixed)
now i've got this question:
is there the possibility for my_datatype.tpl to know the class of the referer?
i need to have something like this:

if the datatype is called from a class1 object should do something
if the datatype is called from a class2 object should do something else

in this way i could avoid to have various datatypes that do similar work

best regards
alessandro

Silke Fox

Monday 07 June 2004 6:36:22 am

Hi Alessandro,

not sure what you're trying to do...
do you want to use different templates for your datatype, depending on the content class
in which the datatype is used?
You could use the template override stuff then, see
http://ez.no/ez_publish/documentation/customization/custom_design/override_templates

Silke

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 31 2025 11:45:01
Script start
Timing: Jan 31 2025 11:45:01
Module start 'layout'
Timing: Jan 31 2025 11:45:01
Module start 'content'
Timing: Jan 31 2025 11:45:03
Module end 'content'
Timing: Jan 31 2025 11:45:03
Script end

Main resources:

Total runtime2.0448 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0105 588.3750151.2422
Module start 'layout' 0.01050.0106 739.617236.6953
Module start 'content' 0.02112.0226 776.3125918.7031
Module end 'content' 2.04370.0010 1,695.01567.8125
Script end 2.0448  1,702.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.1640160.0002
Check MTime0.00130.0646160.0001
Mysql Total
Database connection0.00100.050410.0010
Mysqli_queries1.976396.6500540.0366
Looping result0.00060.0316520.0000
Template Total1.871991.520.9359
Template load0.00220.109020.0011
Template processing1.869691.433520.9348
Template load and register function0.00170.082010.0017
states
state_id_array0.00510.251110.0051
state_identifier_array0.00310.149520.0015
Override
Cache load0.00180.0895220.0001
Sytem overhead
Fetch class attribute can translate value0.00080.040420.0004
Fetch class attribute name0.00230.111930.0008
XML
Image XML parsing0.00200.098920.0010
class_abstraction
Instantiating content class attribute0.00000.000330.0000
General
dbfile0.01280.6269160.0008
String conversion0.00000.000540.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs