Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » img in menu

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

Page: 1
Go to End
Author Topic: 1215 Views
  • mdm
    Community Member
    19 Posts

    img in menu Link to this post

    I am originally custom to ASP code so im perhaps thinking the wrong way here and never the less im primary a designer.
    I want my menu to be images istead of text since we have another tupography for our profile.

    What i first was thinking was in navigation

    <img src="menuitem_$link.gif"> but surly it wouldnt be that easy to make it work.
    To clreaify is that i have menuitem_startpage.gif menuitem_about.gif and with this way i was thinking that the $link would print out to complete the filename since i named the gif images the same as the links.

    Is there a short lined way to make this possible or must I create functions and hassle arround just for this?
    I know for now that we shall only have these menu items we have so sure I could go and hardcode it instead - but to just have a function for it would be smoother becouse then we can change orders in the CMS directly if we want , instead of edit the file manually when we ever feel like changing.

  • mdm
    Community Member
    19 Posts

    Re: img in menu Link to this post

    I managed to fix this with out using functions and just my brain but it including that I had to rename the menuimages with spaces in the filename, this is due to that $Link or what ever cant be in close contact with other objects.

    <img src="images/menuitem_ @MenuTitle .gif"> worked perfect and it will then printout
    <img src="images/menuitem_ Page .gif"> and its all fine for me cus server shows the images on the page.

    If you want a more advanced system sure generated images or flashfile is possible but more coding.
    I have now images already made in images folder called like the MenuTitle so it just fetches them on call.


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.