Template question with ezoe/attribute_view_gui

Author Message

Russell Michell

Thursday 07 January 2010 12:01:32 pm

Hi all, forgive me if this should really be in another forum, but here goes:

I have a template override for content/datatype/view/ezimage.tpl inside a custom extension. The override mechanism is fine, but using the 'attribute_view_gui' template function, I should be able to pass specific input parameters like:

image_class, css_class, link_to_image, href, border_size 

The values to pass to each of these inputs come from either $object, $object_parameters or $link_parameters, and these work apart from for the css_class input. Which object variable contains a CSS class string I can use to pass to the css_class input from an ezoe image-insert popup/dialogue?

Here is the line of code I was staring at for a whole afternoon yesterday: I have hard-coded a CSS class passed to the css_class input which works as expected but I want to take the value of a drop-down menu of CSS classes in an ezoe image-insert popup/dialogue so it's dynamic not static:

{attribute_view_gui attribute=$object.data_map.image 
image_class=$object_parameters.size 
href=$link_parameters.href 
target=$link_parameters.target 
css_class=image-right}<a></a>

I hope I have explained this OK and thanks for reading :-)Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Jérôme Vieilledent

Friday 08 January 2010 5:33:37 am

Hi Russell

When inserting an image in ezoe, you actually embed an image content object (content/view/embed.tpl or content/view/embed-inline.tpl). This is the default, but you can customize by choosing another view among those available in the appropriate dropdown menu.

Best thing to do is to propose a CSS class through content.ini (take look at extension/ezoe/settings/content.ini.append.php). Assuming that you want to have a my-super-css-class, you would have this in your content.ini override :

[embed]
AvailableViewModes[]=embed
AvailableClasses[]=my-super-css-class

[embed-type_images]
AvailableClasses[]=my-super-css-class

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