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