add image to xml block via script

Author Message

Philippe VINCENT-ROYOL

Thursday 02 September 2010 8:17:04 am

Hi guys,

I ve a little big problem :) I ve a class, which contain an attribute called "visual" ( ezimage type ) and an xmlblock called "description"

I would like to insert image into xmlblocks... So the step ll be :

  • get url image storage and add this to a content object relationship
  • add manualy correct code to xmlblock

Or are there some others solutions?

Thanks

Philippe

Certified Developer (4.1): http://auth.ez.no/certification/verify/272607
Certified Developer (4.4): http://auth.ez.no/certification/verify/377321

G+ : http://plus.tl/dspe
Twitter : http://twitter.com/dspe

Damien Pobel

Thursday 02 September 2010 2:41:39 pm

Hi Philippe,

I guess the position of the image in the XML block depends on the editor will. If so, the best solution for you and the editor is probably to define a custom tag. Then the editor can place it where he wants.

Cheers

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Philippe VINCENT-ROYOL

Friday 03 September 2010 1:11:11 am

Thanks Damien,

I ll try and check some xml to result to see that.

Cheers

Certified Developer (4.1): http://auth.ez.no/certification/verify/272607
Certified Developer (4.4): http://auth.ez.no/certification/verify/377321

G+ : http://plus.tl/dspe
Twitter : http://twitter.com/dspe

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 02:00:03
Script start
Timing: Jan 18 2025 02:00:03
Module start 'layout'
Timing: Jan 18 2025 02:00:03
Module start 'content'
Timing: Jan 18 2025 02:00:04
Module end 'content'
Timing: Jan 18 2025 02:00:04
Script end

Main resources:

Total runtime0.7512 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0089 589.8047153.4531
Module start 'layout' 0.00890.0025 743.257839.4063
Module start 'content' 0.01140.7382 782.6641549.3359
Module end 'content' 0.74960.0016 1,332.000012.1563
Script end 0.7512  1,344.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00500.6635160.0003
Check MTime0.00150.1992160.0001
Mysql Total
Database connection0.00080.107010.0008
Mysqli_queries0.682990.8991570.0120
Looping result0.00090.1148550.0000
Template Total0.708094.220.3540
Template load0.00330.437720.0016
Template processing0.704793.807120.3524
Template load and register function0.00020.032110.0002
states
state_id_array0.00240.314810.0024
state_identifier_array0.00090.122520.0005
Override
Cache load0.00290.3903230.0001
Sytem overhead
Fetch class attribute can translate value0.00080.103620.0004
Fetch class attribute name0.00180.241250.0004
XML
Image XML parsing0.00400.534020.0020
class_abstraction
Instantiating content class attribute0.00000.001960.0000
General
dbfile0.00560.7467230.0002
String conversion0.00000.001340.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
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
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.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: 7

Time used to render debug report: 0.0002 secs