Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Active State
#1
Sorry, i didn't know where about to post this.

But my question is, on some templates there is an active state (on the link).

Example:
Code:
<li><a href="index.html" class="active">Home</a></li>

But. because we use get_navigation() and it does it all for us.
Is there a way to get that active state, onto the active page?

If not, any way you think you could implement it?

Cheers
Ant
Visit my portfolio website: http://graphixant.com
Reply
#2
not quiet sure I understand what you need here.
Current page is always the active one.
My Github Repos: Github
Website: DigiMute
Reply
#3
For the main GS site, this is what I use for my CSS to get active states. The key here is that GS always puts the class current on the "active" link's LI element.


Code:
#bodycontent .sidebar ul.nav {list-style:none;margin:0 0 30px 0;width:250px;}

#bodycontent .sidebar ul.nav li {margin:0 0 3px 0;}

#bodycontent .sidebar ul.nav li a {display:block;padding:10px 15px;}

#bodycontent .sidebar ul.nav li a:link, #bodycontent .sidebar ul.nav li a:visited {
background:#436467;
color:#DBE2E3;
}

#bodycontent .sidebar ul.nav li a:hover, #bodycontent .sidebar ul.nav li.current a {
background:#111;
color:#fff;
}
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#4
I forgot to say thanks for this, i'll give it a shot!
Cheers chris!
Visit my portfolio website: http://graphixant.com
Reply
#5
Okay, Chris i just got around to this again as i'm coding my new layout for my portfolio.
Just a quick question, is there any special html?

Are you making any classes in the a href? Is it class="current"?

Tbh i don't get this Tongue. Any explination please.
Visit my portfolio website: http://graphixant.com
Reply
#6
GS adds the class current to the page that is open.
You just need to style the .current condition in your css file and your good to go.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#7
Yah, sorry i done it now Big Grin. I'll pos tmy site in the using gs part.
Visit my portfolio website: http://graphixant.com
Reply




Users browsing this thread: 1 Guest(s)