Submenu (start)

This commit is contained in:
Stefan Schlott 2013-08-24 09:22:41 +02:00
parent c47622688b
commit 13c2164bbd
2 changed files with 16 additions and 8 deletions

View file

@ -1,13 +1,18 @@
def path_section(item)
if (item.path=='/') then
def path_section(item, n=1)
if (n==1 && item.path=='/') then
'main'
else
item.identifier.split('/')[1]
sections = item.identifier.split('/')
if (n<sections.size)
sections[n]
else
''
end
end
end
def menu_active_if(ident, cssclasses='')
if (ident==path_section(item)) then
def menu_active_if(ident, n=1, cssclasses='')
if (ident==path_section(item, n)) then
" class=\"active #{cssclasses}\""
else
" class=\"#{cssclasses}\""