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.

Customising the CMS /

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

img in menu


Go to End


2 Posts   2117 Views

Avatar
mdm

Community Member, 19 Posts

20 February 2009 at 1:56am

Edited: 20/02/2009 4:43am

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.

Avatar
mdm

Community Member, 19 Posts

20 February 2009 at 11:23pm

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.

peace