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.

eZ debug

Timing: Jan 31 2025 03:35:12
Script start
Timing: Jan 31 2025 03:35:12
Module start 'layout'
Timing: Jan 31 2025 03:35:12
Module start 'content'
Timing: Jan 31 2025 03:35:13
Module end 'content'
Timing: Jan 31 2025 03:35:13
Script end

Main resources:

Total runtime1.2542 sec
Peak memory usage8,192.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.0078151.1953
Module start 'layout' 0.00520.0045 739.2031220.6406
Module start 'content' 0.00971.2436 959.84384,447.1016
Module end 'content' 1.25340.0008 5,406.945311.8906
Script end 1.2542  5,418.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2912160.0002
Check MTime0.00130.1006160.0001
Mysql Total
Database connection0.00080.067410.0008
Mysqli_queries1.158392.3538570.0203
Looping result0.00060.0479550.0000
Template Total1.197095.420.5985
Template load0.00250.195820.0012
Template processing1.194595.239020.5973
Template load and register function0.00160.124410.0016
states
state_id_array0.00180.141410.0018
state_identifier_array0.00250.197620.0012
Override
Cache load0.00210.1665440.0000
Sytem overhead
Fetch class attribute can translate value0.00160.130520.0008
Fetch class attribute name0.00200.159240.0005
XML
Image XML parsing0.00240.194520.0012
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00380.3036170.0002
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs