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

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 16:12:53
Script start
Timing: Jan 18 2025 16:12:53
Module start 'layout'
Timing: Jan 18 2025 16:12:53
Module start 'content'
Timing: Jan 18 2025 16:12:54
Module end 'content'
Timing: Jan 18 2025 16:12:54
Script end

Main resources:

Total runtime1.0349 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 587.9063152.6250
Module start 'layout' 0.00490.0023 740.531339.4297
Module start 'content' 0.00721.0260 779.9609595.1172
Module end 'content' 1.03320.0017 1,375.078112.1797
Script end 1.0349  1,387.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3073160.0002
Check MTime0.00120.1186160.0001
Mysql Total
Database connection0.00070.066910.0007
Mysqli_queries0.974394.1460650.0150
Looping result0.00070.0677630.0000
Template Total1.009997.620.5049
Template load0.00190.179420.0009
Template processing1.008097.399220.5040
Template load and register function0.00010.013210.0001
states
state_id_array0.00070.063410.0007
state_identifier_array0.00150.140520.0007
Override
Cache load0.00170.1598380.0000
Sytem overhead
Fetch class attribute can translate value0.00060.059530.0002
Fetch class attribute name0.00320.308760.0005
XML
Image XML parsing0.00200.188930.0007
class_abstraction
Instantiating content class attribute0.00000.002670.0000
General
dbfile0.00200.1939160.0001
String conversion0.00000.000940.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs