Forums / General / get embedded image in short_description

get embedded image in short_description

Author Message

paul bolger

Wednesday 01 June 2011 5:52:45 am

I need to pull an image in the short_description field in a folder. If I use

$child.object.data_map.short_description.object.embedded_contentobject_array.0.current.data_map.image

I seem to get all the embedded objects for the object rather than just the ones in short_description - and in no particular order. How do I call just one field?

Paul Bolger

Peter Keung

Wednesday 01 June 2011 7:28:43 am

Try using the related_objects fetch and specifying an attribute:

http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Modules/content/Fetch-functions/related_objects

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

paul bolger

Thursday 02 June 2011 6:46:58 pm

Thanks Peter, I'll give that a try.

Seems a bit crazy that you can't directly get the embedded objects out of a particular xml field. Has this changed since 3.x? I used the line above in a project a few years ago (3.8) and it seemed to work ok then.

Paul Bolger

eZ debug

Timing: Jan 17 2025 23:36:33
Script start
Timing: Jan 17 2025 23:36:33
Module start 'content'
Timing: Jan 17 2025 23:36:34
Module end 'content'
Timing: Jan 17 2025 23:36:34
Script end

Main resources:

Total runtime1.5170 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0105 587.7266180.8438
Module start 'content' 0.01051.3087 768.5703543.8359
Module end 'content' 1.31930.1976 1,312.4063332.7500
Script end 1.5169  1,645.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.2975210.0002
Check MTime0.00150.0958210.0001
Mysql Total
Database connection0.00130.085110.0013
Mysqli_queries1.441995.05261940.0074
Looping result0.00230.15281920.0000
Template Total1.477797.420.7388
Template load0.00220.145520.0011
Template processing1.475597.264320.7377
Template load and register function0.00010.006610.0001
states
state_id_array0.00070.048610.0007
state_identifier_array0.00180.118220.0009
Override
Cache load0.00180.1194150.0001
Sytem overhead
Fetch class attribute can translate value0.00160.105030.0005
Fetch class attribute name0.00150.099950.0003
XML
Image XML parsing0.00130.083330.0004
class_abstraction
Instantiating content class attribute0.00000.000760.0000
General
dbfile0.00200.1325340.0001
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
3content/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
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs