Jump to:

23486 Posts in 18995 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Including a picture in a menu

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: 1103 Views
  • Naex
    Avatar
    Community Member
    7 Posts

    Including a picture in a menu Link to this post

    Hi. I'm modifying blackcandy's SideBar menu and was trying to add a picture in the list, like so:

    <div id="Sidebar" class="typography">
    <div class="sidebarBox">

    <ul id="Menu2">
    <% control Menu(2) %>
    <% if Children %>
    <li class="$LinkingMode"><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMoode levela"><span><em><img src="../../images/boxorange.gif" />$MenuTitle.XML</em></span></a>
    <% else %>
    <li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode levela"><span><em><img src="../../images/boxorange.gif" />$MenuTitle.XML</em></span></a>
    <% end_if %>

    </li>
    <% end_control %>
    </ul>
    <div class="clear"></div>
    </div>
    <div class="sidebarBottom"></div>
    </div>

    If I put an alt in it shows the alt, but it doesn't ever show the image. Am I doing something wrong?
    Thanks

  • Bruce B
    Avatar
    Community Member
    145 Posts

    Re: Including a picture in a menu Link to this post

    First thing I'd try would be to replace those relative image links with root-relative ones. I strongly suspect that will fix the problem.

    cheers
    bruce

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