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.

Template Questions

Creating an Image (rather than Text)-based menu


5 Posts   482 Views


27 June 2012 at 4:47pm Community Member, 5 Posts

Hi. I am very new to SS, and haven't been programming for well over a decade so I am not quite up to speed with all of the code and syntax in SS. I am trying to create a menu for the home page of my site which uses images as the links instead of text. You can see the page at:

The images are meant to be positioned in the white blocks and look like polaroids.

The code I am using is:
               <ul class="polaroid">
                  <% control Menu(1) %>
                  <a href="$Link" class="pic-{$POS}">$LinkPic</a>
                  <% end_control %>

LinkPic is an image field on all top level pages in the site and I have made sure that an image is uploaded for each page. The code is working, but only for the last item in the menu. Can anyone tell me why and how to fix it?

Eventually, I would like for the Home page to not show up on this menu, but I haven't tackled that problem yet. I am assuming it will be some sort of if statement, but if you have any ideas about that as well, I would be grateful.



27 June 2012 at 6:17pm Forum Moderator, 5511 Posts

If you want to hide a page, untick the 'Show in Menus' checkbox in the CMS ( With the missing images it looks like LinkPic isn't set at all, Make sure you can see the image thumbnail in the CMS.


27 June 2012 at 6:54pm Community Member, 5 Posts

Thanks for the reply. The images are definitely loaded and thumbnails visible.

I actually don't want to hide Home in all menus, just that menu on the home page, so I don't think the checkbox option will do what I need.


27 June 2012 at 7:44pm Forum Moderator, 5511 Posts

Then take a read of the first couple tutorials and introduce yourself to the page types and templates ( You could do something like <% if URLSegment = home %><% else %> your menu code<% end_if %>. Next thing to check - what is $LinkPic? If you try $LinkPic.ID you should see a series of numbers for each image. If you only see 0's then the images aren't attached.


27 June 2012 at 10:08pm Community Member, 5 Posts

Ok...feeling very sheepish and deserve an absolute slap upside the head. I was on such a roll adding pics to each page that I forgot to publish them as I went. Doh!

Thanks for the code reference. I will give that a go and see what I can do. Thank you for all the help.