Mark active path in menu
This commit is contained in:
parent
27f48271e2
commit
c47622688b
2 changed files with 22 additions and 7 deletions
15
lib/menu.rb
Normal file
15
lib/menu.rb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
def path_section(item)
|
||||
if (item.path=='/') then
|
||||
'main'
|
||||
else
|
||||
item.identifier.split('/')[1]
|
||||
end
|
||||
end
|
||||
|
||||
def menu_active_if(ident, cssclasses='')
|
||||
if (ident==path_section(item)) then
|
||||
" class=\"active #{cssclasses}\""
|
||||
else
|
||||
" class=\"#{cssclasses}\""
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue