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!