Forums / Developer / Display images between the article body

Display images between the article body

Author Message

Muhammad Khalid Majeed

Monday 26 April 2004 6:39:29 am

I edit the Article class and add 2 more images. Now, I want to display the article like

1- Image
2- Some text of body
3- Image
4- Some text of body
5- Image
6- Remaining Text

example page: http://news.bbc.co.uk/1/hi/technology/3646825.stm

But as the body is string and i can't insert the image between it. I try to explode the string using explode function but later i read that it is not work for string.... Is there any way that i can do it...

Muhammad Khalid
Software Engineer
www.webgurru.net

Balazs Halasy

Monday 26 April 2004 7:03:41 am

In order to achieve the stuff that you wish to achieve, do this:

Don't add any more attributes to the article class.
Use the power of related objects instead.

Example:

1) Create a couple of images in the "Media" part of eZ publish.
2) Edit an article.
3) Click on the small magnify glass icon (on the right).
4) Locate & select the images that you wish to include (navigate to media using the menu on the left).
5) Back in the article edit mode, the images will be displayed on the right hand side.
6) Copy and paste the XML code that is under each image into the desired positions within the body text-field (this will tell eZ publish to display the images).
7) Publish the thing.

That's it; may the force be with you!

Balazs

PS: Depending on the eZ publish version you're using, you might have to create an override template for images within XML code.

Muhammad Khalid Majeed

Tuesday 04 May 2004 12:45:56 am

Thank Balazs Halasy

But there is a problem. I edit the article class and add 6 more images. Now when i enter any aritcle add more images in it. Now when i need to display the article on the page the body comes in one string only. and it can't display the images by the customized locations. like http://arabia.autospeed.com/cms/A_0174/article.html.

I also try to explode the body by <br> but later i come to know that explode function is not working on string.

Can any one help me in this issue.

Muhammad Khalid
Software Engineer
www.webgurru.net

eZ debug

Timing: Jan 18 2025 18:33:25
Script start
Timing: Jan 18 2025 18:33:25
Module start 'content'
Timing: Jan 18 2025 18:33:26
Module end 'content'
Timing: Jan 18 2025 18:33:26
Script end

Main resources:

Total runtime1.4501 sec
Peak memory usage4,096.0000 KB
Database Queries194

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 587.8281180.8281
Module start 'content' 0.00531.2816 768.6563540.3281
Module end 'content' 1.28700.1631 1,308.9844332.7578
Script end 1.4501  1,641.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.2996210.0002
Check MTime0.00180.1216210.0001
Mysql Total
Database connection0.00080.054410.0008
Mysqli_queries1.379895.15261940.0071
Looping result0.00200.13951920.0000
Template Total1.427798.520.7139
Template load0.00230.161020.0012
Template processing1.425498.291920.7127
Template load and register function0.00010.007210.0001
states
state_id_array0.00050.036310.0005
state_identifier_array0.00070.050020.0004
Override
Cache load0.00190.1301330.0001
Sytem overhead
Fetch class attribute can translate value0.00090.064130.0003
Fetch class attribute name0.00100.067940.0002
XML
Image XML parsing0.00080.056530.0003
class_abstraction
Instantiating content class attribute0.00000.000540.0000
General
dbfile0.00230.1569270.0001
String conversion0.00000.000330.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs