Forums / Developer / New datatypes ? / Comment39670

Author Topic

Bård Farstad

Monday 19 January 2004 11:59:43 pm

Comment39670

You don't need a new datatype to achieve this. You can just add an image and a text field to a class and call it "image map" or "banner". We've used this technique here on ez.no to create the banners with image map or just a plain link.

The attributes for this class are:
* name: text line
* image_map: text field
* banner: image

Here is the template we use for embeded banner objects. (override for embed with class x )

{section show=eq( $object.data_map.image_map.content, true() ) }

<img USEMAP="#banner_map" src={$object.data_map.banner.content["large"].full_path|ezroot} alt="{$object.data_map.name.content}" border="0" />

{$object.data_map.image_map.content}

{section-else}

<a href={$object.data_map.link.content|ezurl(double)}>
<img src={$object.data_map.banner.content["large"].full_path|ezroot} alt="{$object.data_map.name.content}" border="0" /></a>

{/section}

Hope this helps,

--bård

Documentation: http://ez.no/doc