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.

General Questions

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

Navagation Question


Reply

2 Posts   618 Views

Avatar
VirtuallyUknown

14 September 2010 at 7:17am Community Member, 4 Posts

Coming from a design background with static HTML/CSS website experience.
Not sure how or if this is possible.

I have a design that has a horizontal navigation across the top of the site, and what I want to know. Is it possible to have the navigation split in two? Can I have 4 links on one side (own div) then a logo/graphic separator (background image) then another 4 links (own div)?

Thanks in advance for any help.
Eric

Avatar
Martijn

14 September 2010 at 7:36am (Last edited: 14 September 2010 7:37am), Community Member, 271 Posts

Recently I needed the Sitelogo centered with a link to the Homepage and the other menuitems left and right from it.

I solved it like this:

<!-- Navigation.ss -->
<ul>
   <% control Menu(1) %>   
      <li><a href="$Link" title="Go to the $Title.XML page" class="$LinkingMode"><% if ClassName = HomePage %><img src="themes/sometheme/images/logo.jpg" /><% else %><span>$MenuTitle.XML</span><% end_if %></a></li>
   <% end_control %>
</ul>

Note that in this example I have 1 HomePage PageType and the contenteditor is responsible for adding the right amount of pages before and after the homepage.

If you use 1 language and don't want to create a seperate HomePage pageclass you van replace:

if ClassName = HomePage

with

if URLSegment = home

Hope this points you to the right direction.