GetSimple Support Forum
li to not include "current" class? - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Themes (http://get-simple.info/forums/forumdisplay.php?fid=10)
+--- Thread: li to not include "current" class? (/showthread.php?tid=2394)



li to not include "current" class? - TheController - 2011-11-16

Hi all, just installed GetSimple and so far so good with importing my theme in.

There's just one issue I've come across so far and that is with the navigation. In the HTML mark-up I had the following:

Code:
<ul class="Navigation">
<li class="current"><a href="#" title="Homepage"><b>Home</b></a></li>
<li><a href="#" title="Link 1"><b>Link 1</b></a></li>
<li><a href="#" title="Link 2"><b>Link 2</b></a></li>
<li><a href="#" title="Link 2"><b>Link 2</b></a></li>
<li><a href="#" title="Link 2"><b>Link 2</b></a></li>
</ul>

This used CSS for the a:hover of the links to have the same CSS as "current" which gave a rollover effect.

Currently with GetSimple the list's current class would change to class="current index", class="current about" etc. Is there anyway I can stop this to just get it back to "current"?

I've found the following PHP code in theme_functions.php in admin/inc, though I'm hopeless with PHP and haven't a clue how to change it.

Code:
if ($page['menuStatus'] == 'Y') {
                if ("$currentpage" == "$url_nav") { $classes = "current". $page['parent'] ." ". $url_nav; } else { $classes = trim($page['parent'] ." ". $url_nav); }
                if ($page['menu'] == '') { $page['menu'] = $page['title']; }
                if ($page['title'] == '') { $page['title'] = $page['menu']; }
                $menu .= '<li class="'. $classes .'"><a href="'. find_url($page['url'],$page['parent']) . '" title="'. strip_quotes($page['title']) .'">'.$page['menu'].'</a></li>'."\n";
            }

MTIA


li to not include "current" class? - Connie - 2011-11-16

can't you define the classes which you do not want just empty? so that they don't have any effect?
Why not?


li to not include "current" class? - mvlcek - 2011-11-16

TheController Wrote:Currently with GetSimple the list's current class would change to class="current index", class="current about" etc. Is there anyway I can stop this to just get it back to "current"?

What's the problem with this? The li has two classes, current and index. If you don't define a rule for class index, it has no impact.


li to not include "current" class? - TheController - 2011-11-17

Thanks for the replies.

I managed to work out what was going wrong. I forgot that for the rollover I used a restyled <b> tag so I've added that in and it's working now.

One issue though ... if I go to "Airport Information" at the top, it still keeps "Home" as the current link in the navigation bar despite being on /airport-information/ ... any ideas why this is happening?

Also mvlcek - absolutely excellent plug-ins, thank you very much for them! I think I'm going to end up using them all.


li to not include "current" class? - mvlcek - 2011-11-17

TheController Wrote:One issue though ... if I go to "Airport Information" at the top, it still keeps "Home" as the current link in the navigation bar despite being on /airport-information/ ... any ideas why this is happening?

Your relevant css rules are li.index ... instead of li.current ...


li to not include "current" class? - TheController - 2011-11-17

Thanks mvlcek, I changed .current to .index in the CSS late last night to try and fix it and forgot to change it back.

Pretty obvious error, now fixed - thanks for the help ;o)

Best wishes