ps: if you are on the case where you need to have home highlighted by
default no matter what, use this javascript snippet (pretty straightforward)
Added also a filter() to exclude the registration/login/etc links from
being highlighted
jQuery(function() {
var path = location.pathname.substring(1);
if ( path ) {
var els = jQuery('ul.nav a[href$="'+path+'"]').filter(
"[rel!=nofollow]");
if (els.length != 0) {
els.closest('li').addClass('highlighted');
} else {
jQuery('ul.nav a[href$="/highlight/default/index"]').closest(
'li').addClass('highlighted');
}
}
})
PS: maybe to make it more clearer, use a Home link with an id, such as
(SPAN('Home', _id='default_highlighted'), False, URL('default', 'index'),
[]),
so you can switch the last line from
jQuery('ul.nav a[href$="/highlight/default/index"]').closest('li').addClass(
'highlighted');
to
jQuery('#default_highlighted').closest('li').addClass('highlighted');
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.