Displaying a related object from an XML-field.

Author Message

Bjørn Kaarstein

Wednesday 02 April 2003 12:52:06 am

I have created an article-class which contains an XML-field. I have created an image and related it to the article, and pasted the code in the XML-field. (<object id='26' />)

I'm trying do display the XML-field like this:

{let var=fetch('content','node',hash(node_id,28))}
{$var.object.data_map.innhold.content.output.output_text}
{/let}

This displays the text, but not the related image ...

Any suggestions?

Regards Bjørn Kaarstein

Jan Borsodi

Wednesday 02 April 2003 10:49:40 pm

The object relation in the xml fields uses the embed view for content objects, this means that you need to create override templates for embed.tpl for the various classes you create.

See design/standard/templates/content/view/embed.tpl for the original embed template, and design/admin/override/templates/content/view/embed_class_5.tpl for an example template for the image class which is bundled with the kernel clean setup.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

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 15:54:37
Script start
Timing: Jan 18 2025 15:54:37
Module start 'layout'
Timing: Jan 18 2025 15:54:37
Module start 'content'
Timing: Jan 18 2025 15:54:38
Module end 'content'
Timing: Jan 18 2025 15:54:38
Script end

Main resources:

Total runtime1.0037 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.0051 588.0469152.6406
Module start 'layout' 0.00510.0024 740.687539.4766
Module start 'content' 0.00750.9949 780.1641520.4453
Module end 'content' 1.00230.0014 1,300.60948.2813
Script end 1.0037  1,308.8906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3027160.0002
Check MTime0.00140.1388160.0001
Mysql Total
Database connection0.00080.081610.0008
Mysqli_queries0.958995.5340540.0178
Looping result0.00050.0486520.0000
Template Total0.968596.520.4843
Template load0.00190.186620.0009
Template processing0.966796.305420.4833
Template load and register function0.00030.031710.0003
states
state_id_array0.00130.125210.0013
state_identifier_array0.00200.198320.0010
Override
Cache load0.00150.1534150.0001
Sytem overhead
Fetch class attribute can translate value0.00050.050720.0003
Fetch class attribute name0.00130.125430.0004
XML
Image XML parsing0.00070.065120.0003
class_abstraction
Instantiating content class attribute0.00000.000730.0000
General
dbfile0.00280.2827170.0002
String conversion0.00000.000840.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/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/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs