New datatypes ?

Author Message

Vincent Basset

Monday 19 January 2004 8:04:58 am

Hello,

is it possible to add new datatypes ?

here's an example :
I want to create an article with an image and an imagemap.
so i create a new class called "ImageMapArticle" with a title, desc, text and image.
But what about the attributes of the imagemap ?
I need to set many couples of (name, coords, link), so I need to create a new datatype which will join the 3 values... :/

is it possible ?

thx !

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

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