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

Author Message

Aldo Bucchi

Wednesday 30 April 2003 11:53:09 am

Hi,
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?

Cheers,
Aldo

Paul Borgermans

Wednesday 30 April 2003 1:02:15 pm

>Can I embed images in an ezXML atribute?

Yes

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.

hth

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Aldo Bucchi

Thursday 01 May 2003 10:51:15 am

Thanks Paul, that's exactly what I needed to know.
:-)
Aldo

Ibrahim Khachab

Wednesday 01 October 2003 8:14:07 am

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?

Thanks

Paul Forsyth

Wednesday 01 October 2003 8:53:16 am

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:

p
{
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.

paul

Ibrahim Khachab

Wednesday 01 October 2003 9:05:12 am

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.

Paul Forsyth

Wednesday 01 October 2003 9:18:57 am

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

Look at the files within:

design/standard/templates/content/datatype/view/ezxmltags/

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 :)

Paul

Ibrahim Khachab

Thursday 02 October 2003 12: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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.