eZ Community » Forums » General » Displaying custom class images -...

Displaying custom class images - ezimagealiashandler

Displaying custom class images - ezimagealiashandler

Friday 20 April 2007 9:11:54 pm - 2 replies


I've just started using eZ publish (latest version) and am having trouble displaying images that I'm retrieving from a custom class.

It seems like it should be such a simple thing to do but I haven't been able to find a solution anywhere. Here's my code:

{def $winners=fetch( 'content', 'tree',
hash( 'parent_node_id', 82,
'attribute_filter', $search_array ) )}

{foreach $winners as $w}
{* display selection id *}

{* display image....? Line below outputs "Object(ezimagealiashandler)" *}

The code is retrieving my custom objects just fine but after searching for everything i can think of I still can't figure out how to display the image properly. Even the code to display a selection id seems unnecessarily complicated...surely there's an easier way to access an attribute (by name) ?

Would greatly appreciate any help anyone could give me.



Friday 20 April 2007 9:42:59 pm

Hi Michael,

Simple. As expected. happy.gif Emoticon

You can use the <b>attribute_view_gui</b> operator.

{attribute_view_gui attribute=$w.object.contentobject_attributes[6] image_class=(small|large|original|*any-other-format-youve-defined)}

Besides, rather than


you can use something like


It will be much more easier to maintain and in case you change the orders of your attributes in your content class, you won't need to change your templates.

Friday 20 April 2007 9:50:37 pm

Exactly what i needed. Thanks for such a quick reply!


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from