Forums / Setup & design / ezimage

ezimage

Author Message

Koen Colen

Friday 19 January 2007 8:08:36 am

A question,
in pagelayout.tpl I want to display an image...

<img src={'menu_sign.jpg'|ezimage} width="149" height="57" alt="" border="0" />

If I run this in my browser the source code looks like this...

<img src="menu_sign.jpg" alt="" border="0" height="57" width="149">

What can I be doing wrong? I like the path to be perpended by the path to the folder my images are in like...

var/storage/packages/local/new_design/files/default/file/images/menu_sign.jpg

I also tried uploading the menu_sign.jpg image in the media library but that doesn't work either.

Another question. Can I orden my images in the "var/storage/packages/local/new_design/files/default/file/images" folder?
I mean can I make subfolders in that folder like "icons", "buttons" or are those locations kept in the db someway or another so I don't have to mess with it?

Many thanks in advance!

kracker (the)

Friday 19 January 2007 9:06:39 pm

Hello,

You can use an image uploaded inside eZ publish by writing a fetch to get the image and it's details from the content structure.
<i>http://ez.no/doc/ez_publish/technical_manual/3_8/reference/modules/content/fetch_functions/list</i>

Yet I would recommend, first moving your image into your design folder's image folder. Example: <i>design/exampledesign/images/</i>

After doing this, your example source code is close but not quite correct. Try changing your code to look like this ...

<img src={"menu_sign.jpg"|ezimage} width="149" height="57" alt="" border="0" />

This will output the design folder's location and the file similar to '/design/exampledesign/images/menu_sign.jpg'.

<i>http://ez.no/doc/ez_publish/technical_manual/3_8/reference/template_operators/urls/ezimage</i>

<i>hth,
//kracker</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Koen Colen

Wednesday 24 January 2007 8:12:47 am

Thanks for the quick reply Kracker.
Still I cannot get it to work.
Is it normal that I have to create the folder inside the design directory myself (that it's not created by the system during install or during the creation of a new sitestyle package)?

Currently I have 3 folders in the design directory (admin, base & ezwebin), do I have to create a new one with the same name as the siteaccess ?

Correct me if I'm wrong please:

- media that belongs to a sitestyle goes into the "var/storage" directory during install of sitestyle, content writers cannot mess with it.
- media that's not in the sitestyle but that I like to add in a template afterwards (like the menu_sign.jpg), I copy to the design directory
- media that can be inserted in the content of pages gets uploaded by the user to the media library and gets stored in the "var/ezwebin_site" folder

I really want to get my head around this EZpublish thing, I sense it's very powerful with the object approach on almost anything.
Kind of a lot to start with but I'm pretty sure that pays off afterwards in flexibility.

Tnx!

eZ debug

Timing: Jan 31 2025 04:14:52
Script start
Timing: Jan 31 2025 04:14:52
Module start 'content'
Timing: Jan 31 2025 04:14:52
Module end 'content'
Timing: Jan 31 2025 04:14:52
Script end

Main resources:

Total runtime0.2341 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.0052 587.7500180.8594
Module start 'content' 0.00520.0287 768.609497.9219
Module end 'content' 0.03390.2001 866.5313522.9375
Script end 0.2341  1,389.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00351.4932200.0002
Check MTime0.00150.6238200.0001
Mysql Total
Database connection0.00060.256710.0006
Mysqli_queries0.160368.48731410.0011
Looping result0.00110.46621390.0000
Template Total0.199785.310.1997
Template load0.00170.722310.0017
Template processing0.198084.570110.1980
Override
Cache load0.00060.274210.0006
Sytem overhead
Fetch class attribute can translate value0.00110.456610.0011
XML
Image XML parsing0.00040.174210.0004
General
dbfile0.024110.3065200.0012
String conversion0.00000.002130.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