silverstrap 

silverstrap Commit Details

Date:2013-06-11 21:23:11 (6 years 3 months ago)
Author:Nicola Fontana
Branch:bootstrap2, dev, master, master-1.0, ss3
Commit:e317736d9b807698ea5ef9a1e5c8ca10e9429a1b
Parents: a8bfe573472598f8da0db1e8bf48544e6d40bf41
Message:Added multilevel page support to navbar

Changes:
AREADME (full)
Alang/en.yml (full)
Alang/it.yml (full)
Atemplates/Includes/NavbarItem.ss (full)
Mtemplates/Includes/Content.ss (1 diff)
Mtemplates/Includes/Navbar.ss (1 diff)
Mtemplates/Includes/Sitemap.ss (1 diff)

File differences

README
1
2
3
4
5
6
7
The default implementation provides support for custom nested levels
but does not give access to the parent nodes. To have this access
enabled you can add a fixed element as the first item to every submenu:
<li class="$LinkingMode">
<a href="$Link.ATT" title="<%t Silverstrap.GOTO page=$Title.ATT %>">$Title</a>
</li>
lang/en.yml
1
2
3
en:
Silverstrap:
GOTO: 'Go to {page} page'
lang/it.yml
1
2
3
it:
Silverstrap:
GOTO: 'Vai alla pagina {page}'
templates/Includes/Content.ss
44
55
66
7
7
88
99
1010
</aside>
<div class="span9"><% else %>
<div class="span12"><% end_if %>
<main id="content" role="main"><% if Title %>
<main id="content" role="main"><% if $Title %>
<div class="page-header"><h1>$Title</h1></div><% end_if %>
$Content
</main>
templates/Includes/Navbar.ss
11
22
33
4
5
6
4
5
6
77
88
99
<header class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="/">$SiteConfig.Title</a><% if Menu(1) %>
<ul class="nav"><% loop Menu(1) %>
<li class="$LinkingMode"><a href="$Link" title="Vai alla pagina '$Title'">$MenuTitle</a></li><% end_loop %>
<a class="brand" href="/">$SiteConfig.Title</a><% if $Menu(1) %>
<ul class="nav"><% loop $Menu(1) %>
<% include NavbarItem Mode="dropdown" %><% end_loop %>
</ul><% end_if %>
</div>
</div>
templates/Includes/NavbarItem.ss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<% if $Children %>
<li class="$Mode">
<a href="$Link.ATT" class="dropdown-toggle" data-toggle="dropdown">
$Title<% if $Mode=="dropdown" %>
<b class="caret"></b><% end_if %>
</a>
<ul class="dropdown-menu"><% loop $Children %>
<% include NavbarItem Mode="dropdown-submenu" %><% end_loop %>
</ul>
</li>
<% else %>
<li class="$LinkingMode">
<a href="$Link.ATT" title="<%t Silverstrap.GOTO page=$Title.ATT %>">$Title</a>
</li>
<% end_if %>
templates/Includes/Sitemap.ss
11
22
33
4
4
55
66
77
8
8
99
1010
1111
<div class="well">
<div class="container">
<div class="row">
<div class="span12"><% loop Menu(1) %><% if Children %>
<div class="span12"><% loop $Menu(1) %><% if $Children %>
<div class="span2" style="width: 15%;">
<ul class="unstyled">
<li><strong><a href="$Link" title="$Title">$MenuTitle</a></strong><li>
<li class="divider-vertical"></li><% loop Children %>
<li class="divider-vertical"></li><% loop $Children %>
<li><a href="$Link" title="$Title">$MenuTitle</a><li><% end_loop %>
</ul>
</div><% end_if %><% end_loop %>

Archive Download the corresponding diff file