Forums / Setup & design / Embeded images in article (variable number, placement and formats)

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

eZ debug

Timing: Jan 30 2025 00:14:45
Script start
Timing: Jan 30 2025 00:14:45
Module start 'content'
Timing: Jan 30 2025 00:14:45
Module end 'content'
Timing: Jan 30 2025 00:14:45
Script end

Main resources:

Total runtime0.2172 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.0044 588.2031180.7969
Module start 'content' 0.00440.0053 769.0000101.9766
Module end 'content' 0.00980.2074 870.9766530.4531
Script end 0.2171  1,401.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00311.4315200.0002
Check MTime0.00130.6049200.0001
Mysql Total
Database connection0.00040.182810.0004
Mysqli_queries0.178682.22961410.0013
Looping result0.00080.37681390.0000
Template Total0.207095.310.2070
Template load0.00080.362010.0008
Template processing0.206394.973510.2063
Override
Cache load0.00050.244510.0005
Sytem overhead
Fetch class attribute can translate value0.00060.261510.0006
XML
Image XML parsing0.00020.109110.0002
General
dbfile0.00783.5732200.0004
String conversion0.00000.002330.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.0001 secs