Forums / Setup & design / ImageMap as custom class with related objects

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.

eZ debug

Timing: Jan 19 2025 12:50:44
Script start
Timing: Jan 19 2025 12:50:44
Module start 'content'
Timing: Jan 19 2025 12:50:45
Module end 'content'
Timing: Jan 19 2025 12:50:45
Script end

Main resources:

Total runtime1.5029 sec
Peak memory usage4,096.0000 KB
Database Queries183

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0078 589.0859180.8125
Module start 'content' 0.00781.3299 769.8984415.4453
Module end 'content' 1.33770.1651 1,185.3438333.7813
Script end 1.5028  1,519.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.2857210.0002
Check MTime0.00150.1012210.0001
Mysql Total
Database connection0.00120.076910.0012
Mysqli_queries1.443696.05721830.0079
Looping result0.00170.11431810.0000
Template Total1.464197.420.7320
Template load0.00220.148020.0011
Template processing1.461897.266820.7309
Template load and register function0.00010.008910.0001
states
state_id_array0.00460.303810.0046
state_identifier_array0.00180.120520.0009
Override
Cache load0.00180.120390.0002
Sytem overhead
Fetch class attribute can translate value0.00110.073120.0005
Fetch class attribute name0.00050.032210.0005
XML
Image XML parsing0.00040.026620.0002
class_abstraction
Instantiating content class attribute0.00000.000210.0000
General
dbfile0.00180.1172210.0001
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs