Jump to:

23371 Posts in 18161 Topics by 2865 members

General Questions

SilverStripe Forums » General Questions » Image Maps

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

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

Page: 1
Go to End
Author Topic: 1191 Views
  • Haggis
    Avatar
    Community Member
    4 Posts

    Image Maps Link to this post

    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>

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: Image Maps Link to this post

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

  • Haggis
    Avatar
    Community Member
    4 Posts

    Re: Image Maps Link to this post

    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

  • webtonic
    Avatar
    Community Member
    26 Posts

    Re: Image Maps Link to this post

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

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Image Maps Link to this post

    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)

  • Haggis
    Avatar
    Community Member
    4 Posts

    Re: Image Maps Link to this post

    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

  • Ryan M.
    Avatar
    Community Member
    309 Posts

    Re: Image Maps Link to this post

    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...

    1191 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.