ImageMap as custom class with related objects

Author Message

Dustin Machi

Wednesday 14 April 2004 11:44:29 pm

I created a couple of new classes, one called imagemap and the other called mapareas. In the imagemap class I created a few fields for things like names and the image itself, then I added a "object relation list" which I can add mapareas to the object. Ultimately I include this object in an article or whatever, therefor I have created a custom template for /content/view/embed.tpl I got this new template working to display the image, however I cannot figure out despite having read a thousand somewhat related messages in this forum how to go through the object relation list and create the actual map area lines I need.

Here is an example of the template. The first part is just a standard template for viewing the image instead of a link to the image that I also figured out by reading this site. The last part however, where I actually build the <map></map> part doesn't work as I can't go through the list. Any suggestions would be <b>extremely</b> helpful...beside saving my sanity somewhat, it will also greatly assist in keeping me from getting further behind at work.

{let image_variation="false"
align="center"}
{set image_variation=$object.data_map.map_image.content["original"]}
{set align="center"}


{switch match=$align}

{case match="left"}
<div class="imageleft">
<img src={$image_variation.full_path|ezroot} /USEMAP="{$object.name|wash}">
</div>
{/case}

{case match="right"}
<div class="imageright">
<img src={$image_variation.full_path|ezroot} USEMAP="{$object.name|wash}"/>
</div>
{/case}

{case}
<div class="imagecenter">
<img src={$image_variation.full_path|ezroot} USEMAP="{$object.name|wash}"/>
</div>
{/case}
{/switch}

<MAP NAME="{$object.name|wash}">
    {section name=rel loop=$object.map_coordinates}

<area shape='rect' coords='0,178,123,202' href='participants.php?link=link7' title='Participants' alt='Participants' >
       <area shape='rect' coords='{$rel:item.data_map.origin_x},{$rel:item.data_map.origin_y},{$rel:item.data_map.end_x},{$rel:item.data_map.end_y}' href='{$rel:item.data_map.url|EzURL}' alt='{$rel:item.data_map.name}' />
    {/section}
</MAP>
{/let}

When I do this the only thing that ends up showing up in the page sources

   <MAP NAME="Image maps name">
   </MAP>

Thanks for any help.

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 19 2025 13:53:56
Script start
Timing: Jan 19 2025 13:53:56
Module start 'layout'
Timing: Jan 19 2025 13:53:56
Module start 'content'
Timing: Jan 19 2025 13:53:57
Module end 'content'
Timing: Jan 19 2025 13:53:57
Script end

Main resources:

Total runtime0.6207 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 589.2891152.6406
Module start 'layout' 0.00660.0027 741.929739.4766
Module start 'content' 0.00930.6101 781.4063410.3516
Module end 'content' 0.61940.0012 1,191.75788.1250
Script end 0.6207  1,199.8828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.5473160.0002
Check MTime0.00130.2036160.0001
Mysql Total
Database connection0.00100.155110.0010
Mysqli_queries0.585594.3312460.0127
Looping result0.00050.0752440.0000
Template Total0.591195.220.2955
Template load0.00180.297520.0009
Template processing0.589294.928420.2946
Template load and register function0.00020.039010.0002
states
state_id_array0.00100.162110.0010
state_identifier_array0.00120.189920.0006
Override
Cache load0.00150.241790.0002
Sytem overhead
Fetch class attribute can translate value0.00060.097810.0006
Fetch class attribute name0.00070.111810.0007
XML
Image XML parsing0.00010.014510.0001
class_abstraction
Instantiating content class attribute0.00000.000710.0000
General
dbfile0.00130.2053100.0001
String conversion0.00000.001640.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs