Forums / Setup & design / how can a datatype know from which object is called?

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

eZ debug

Timing: Jan 19 2025 04:22:19
Script start
Timing: Jan 19 2025 04:22:19
Module start 'content'
Timing: Jan 19 2025 04:22:19
Module end 'content'
Timing: Jan 19 2025 04:22:19
Script end

Main resources:

Total runtime0.0194 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.0081 589.1797180.8125
Module start 'content' 0.00810.0053 769.992293.9297
Module end 'content' 0.01340.0060 863.921970.7031
Script end 0.0193  934.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002110.8803120.0002
Check MTime0.00105.2274120.0001
Mysql Total
Database connection0.00094.650810.0009
Mysqli_queries0.003517.964140.0009
Looping result0.00000.104520.0000
Template Total0.005628.810.0056
Template load0.00147.286710.0014
Template processing0.004221.518310.0042
Override
Cache load0.00115.440110.0011
General
dbfile0.00052.4453100.0000
String conversion0.00000.027030.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