Forums / General / Add img tag in xml block

Add img tag in xml block

Author Message

Domenico Garozzo

Thursday 09 July 2009 10:51:30 am

Hi,
my problem is that i want import post from wordpress blog into my new ez site.
Now, worpress insert image into text using html tag

bla bla bla <img src="http://www......" /> bla bla bla

How i can insert image in xml block? Can i use literal?
Thanks.

Max Keil

Thursday 09 July 2009 2:53:18 pm

Hi Domenico,

do you have the editor activated? If yes - then you have a button on the top with a tree icon.
If your editor is deactivated, try to activate em or add something like this :
<embed size="medium" view="full" href="ezobject://1684" />

I hope it helps you so far.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Domenico Garozzo

Friday 10 July 2009 1:14:09 am

I cannot use editor because i import the wordpress post by my php script.
Now, how, using php script, can i add html img tag into the ezxmltype attribute?

Friday 10 July 2009 8:23:41 pm

The proper way would be to import those images as separate objects and then embed those objects in the XML blocks.

The quick and dirty way to get images into XML blocks (useful if you really must reference external images) is to use custom tags.

A little outline:

In content.ini.append.php

[CustomTagSettings]
AvailableCustomTags[]=ext_image
IsInline[ext_image]=true

[ext_image]
CustomAttributes[]=ext_src
CustomAttributes[]=ext_alt

------------------------------------------

Template for this custom tag:

design/designname/templates/content/datatype/view/ezxmltags/ext_image.tpl

<img src="{$ext_src}" alt="{$ext_alt}" />

------------------------------------------

Example usage in an XML block:

<custom name="ext_image" ext_alt="This comic makes me feel good about working in Open Source" ext_src="http://www.socialsignal.com/system/files/images/2007-09-11-sunset.gif"></custom>

Max Keil

Saturday 11 July 2009 1:42:42 pm

Hi,

you should import your images via an entension like data import:
http://ez.no/developer/contribs/import_export/data_import

after this you would have image objects in your eZ which can be embed in regular way or with a script which would repair the links.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

eZ debug

Timing: Jan 30 2025 00:52:36
Script start
Timing: Jan 30 2025 00:52:36
Module start 'content'
Timing: Jan 30 2025 00:52:36
Module end 'content'
Timing: Jan 30 2025 00:52:36
Script end

Main resources:

Total runtime0.2121 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 587.9063180.8438
Module start 'content' 0.00600.0072 768.750097.9453
Module end 'content' 0.01320.1989 866.6953526.2734
Script end 0.2120  1,392.9688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00371.7212200.0002
Check MTime0.00160.7424200.0001
Mysql Total
Database connection0.00070.349810.0007
Mysqli_queries0.163877.23011410.0012
Looping result0.00150.69131390.0000
Template Total0.198593.610.1985
Template load0.00090.424310.0009
Template processing0.197693.167410.1976
Override
Cache load0.00050.234710.0005
Sytem overhead
Fetch class attribute can translate value0.00120.550210.0012
XML
Image XML parsing0.00030.125910.0003
General
dbfile0.00683.1979200.0003
String conversion0.00000.002430.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
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.0002 secs