Share » Forums » Developer » New datatypes ?

New datatypes ?

New datatypes ?

Monday 19 January 2004 8:04:58 am - 2 replies

Author Message

Vincent Basset

Monday 19 January 2004 8:10:39 am

I forgot one thing : I've read that extensions should help me creating new datatypes, but is it possible to create a type including many others ?

I'll try to explain :

I want to create an ImageMap
An ImageMap looks like this :

<map name="Map">
<area shape="poly" coords="64,103,.....,63,110" href="page1.php">
<area shape="poly" coords="196,81,.....,194,89" href="page2.php">
<area shape="poly" coords="184,104,......,174,119" href="page3.php">
</map>

so I need to create 2 types :

1 - the "ImageMapShape" type which will include a text for the name, a texte for the coords and a text for the link

2 - the "ImageMap" type which will include an image and any number of ImageMapShape !!!

is it possible ???

Thanks a lot ! :):):)

Bård Farstad

Monday 19 January 2004 11:59:43 pm

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

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

36 542 Users on board!

Forums menu