Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Image Maps


Go to End


7 Posts   2416 Views

Avatar
Haggis

Community Member, 4 Posts

28 October 2010 at 10:12am

Image Maps

Why wont my image map work in a page? The html seems OK (see below) but I will be blowed if I can get it working.

<img class="left" src="assets/Uploads/Welcome.png" alt="Course Schedule" width="300" height="300" usemap="#Welcome" Title=""/></p>
<map name="Welcome">
<area shape="rect" coords="68,5,230,54" href="http://www.redrope.org.uk" target="_blank" alt="Welcome" />
<area shape="rect" coords="65,65,233,181" href="http://www.bbc.org.uk" target="_blank" alt="Saturday" />
<area shape="rect" coords="61,196,236,295" href="http://www.riverside.org.uk" target="_blank" alt="Sunday" />

</map>

</p>

Avatar
Ryan M.

Community Member, 309 Posts

28 October 2010 at 11:58am

What exactly are you having problems with? Are the maps un-clickable, or does it seem off, or what?

Avatar
Haggis

Community Member, 4 Posts

29 October 2010 at 12:04am

Hi Ryan M

When I hover the mouse over the cursor does not change and click on the map it does not work at all.

Haggis

Avatar
webtonic

Community Member, 26 Posts

29 October 2010 at 7:13am

Your code appears to work when I pasted it into editor and viewed it. How are you adding the code to the page?

Avatar
Hamish

Community Member, 712 Posts

29 October 2010 at 12:29pm

It could be caused by hashlink rewriting - another piece of SSViewer magic that can get in the way some times. Try adding this to _config.php:

SSViewer::setOption('rewriteHashlinks', false)

Avatar
Haggis

Community Member, 4 Posts

2 November 2010 at 3:30am

Hi

The problems I had was when I was using the code in a site on locahost when usingthe exact same code on a site on a server on a hosting service it worked!

I did not do anything different so is it something about using it on localhost?

Mike

Avatar
Ryan M.

Community Member, 309 Posts

2 November 2010 at 10:42am

Depends on how your local .htaccess file is setup, and if you're including the base href tag in your template.

For example, my local .htaccess requires an URL rewrite in the style of http://localhost:8888/ProjectName/silverstripe directory here...