This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » Setup & design » Embeded images in article (variable...

Embeded images in article (variable number, placement and formats)

Embeded images in article (variable number, placement and formats)

Wednesday 30 April 2003 8:53:09 pm - 7 replies

I need a way to publish an article with many images in it. The number, placing and format of imgs may vary from article to article.

I could define a class with, say 10 image attributes, and then place each in the template in fixed positions. But that's not the idea...

Can I embed images in an ezXML atribute?


Wednesday 30 April 2003 10:02:15 pm

>Can I embed images in an ezXML atribute?


From the manual, every day functions, tags:

<object id="id" align="left|right|center" size="small|medium|large" view="embed|text_linked"/> where 'id' should be an existing eZ object id and all other three attributes are optional.

You can first add the images as related objects to the article, then use the related object id in <object id="id" ... /> as displayed in the related objects box in the admin interface. Alternatively use the node id (which is what you see in the url of the admin/content part), in this case it gets added as a related object automatically.



Modified on Wednesday 30 April 2003 10:04:01 pm by Paul Borgermans

Thursday 01 May 2003 7:51:15 pm

Thanks Paul, that's exactly what I needed to know.
happy.gif Emoticon

Wednesday 01 October 2003 5:14:07 pm

Hi all,

I tried it but I'm having a strange effect with it. I'm getting some space between text lines. I looked at the html produced and I found that each part of the xml text (before and after tha boject) starts with <p> and end with </p>. I made some tests and foud out that these tags produce the space between lines.
Is there a way to get red of it?


Wednesday 01 October 2003 5:53:16 pm

You can solve this overriding the default behaviour of the css tags that apply to the <p> tag.

The standard core.css declares <p> as having this formatting:

padding-top: 0.5ex;
padding-bottom: 0.5ex;
margin: 0px;

This is where your spaces are coming from. <p> has padding above and below it, as you would expect from a paragraph.

You can override this in your own stylesheet with settings but this would apply to every <p>. You may want to localise it by:

div p, td p
padding-top: 0.5ex;
padding-bottom: 0.5ex;
margin: 0px;

or something similar. look in the html source for the html tags around your problematic <p>.

This is a bit technical but i hope you see what im getting at here.


Modified on Wednesday 01 October 2003 5:54:08 pm by Paul Forsyth

Wednesday 01 October 2003 6:05:12 pm

Thank you Paul for the reply.

My question was if it is possible not to have it in the code generated. I think that some code that is processing the xml field is inserting these <p> and </p> tags. These tags are not in my xml code.

Is there any way to disble it?

Thanks again.

Wednesday 01 October 2003 6:18:57 pm

You can either override the basic ezxmltags in your site design or change the existing tags.

Look at the files within:


paragraph.tpl is the one you are after.

Changing these tags affects the html your xmlfield will convert to. It is recommended that you override the ones you want.

Adding css to affect the tags is a neater way of controlling their behaviour happy.gif Emoticon


Modified on Wednesday 01 October 2003 6:19:42 pm by Paul Forsyth

Thursday 02 October 2003 9:30:17 am

Hi Paul,

Thank you very much.
I tried both solution and I prefer the output of the override of the template.

Thank you again


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from