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

Including a picture in a menu


Go to End


2 Posts   1842 Views

Avatar
Naex

Community Member, 7 Posts

14 August 2009 at 2:17am

Edited: 14/08/2009 2:19am

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

Avatar
Bruce B

Community Member, 164 Posts

14 August 2009 at 12:56pm

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