Posted By

nico65 on 05/07/11


Tagged

navigation joomla 16


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

matt0309


Joomla 1.6 add "first" and "last" CSS classes to mod_menu


 / Published in: PHP
 

URL: http://forum.joomla.org/viewtopic.php?p=2459568#p2459568

Copy /modules/modmenu/tmpl/default.php to /templates/MYTEMPLATE/html/modmenu/default.php

  1. // Replace
  2. if ($item->deeper) {
  3. $class .= 'deeper ';
  4. }
  5.  
  6. // with this
  7. $currentitemcount ++;
  8. if ($item->shallower or $currentitemcount == count($list)) {
  9. $class .= 'last ';
  10. }
  11.  
  12. if ($lastdeeper or $currentitemcount == 1) {
  13. $class .= 'first ';
  14. }
  15.  
  16.  
  17. if ($item->deeper) {
  18. $class .= 'deeper ';
  19. $lastdeeper = true;
  20. } else {
  21. $lastdeeper = false;
  22. }

Report this snippet  

You need to login to post a comment.