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!

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

eZ debug

Timing: Jan 18 2025 22:37:06
Script start
Timing: Jan 18 2025 22:37:06
Module start 'layout'
Timing: Jan 18 2025 22:37:06
Module start 'content'
Timing: Jan 18 2025 22:37:06
Module end 'content'
Timing: Jan 18 2025 22:37:06
Script end

Main resources:

Total runtime0.0191 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.8984152.6094
Module start 'layout' 0.00570.0038 741.507839.3984
Module start 'content' 0.00950.0076 780.906393.3984
Module end 'content' 0.01710.0020 874.304734.3047
Script end 0.0191  908.6094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002513.3160140.0002
Check MTime0.00115.7591140.0001
Mysql Total
Database connection0.00094.566810.0009
Mysqli_queries0.003719.505930.0012
Looping result0.00000.063710.0000
Template Total0.00157.910.0015
Template load0.00084.257210.0008
Template processing0.00073.650510.0007
Override
Cache load0.00062.916410.0006
General
dbfile0.00021.267280.0000
String conversion0.00000.041240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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