PHP/Bootstrap active state
- Started
- Last post
- 3 Responses
- Continuity
So, I'm experimenting with Bootstrap hooked into a PHP site. )I'm not a developer, so keep that in mind.)
The way this site works is that it insert a URL in the nav, which sits in a separate file. In the file itself, it's just the one line of code:
<li class=""><a href="index.php?module={CLASS}" onFocus="if(this.blur)this.blur()">{NAME}</a></li>
Where {CLASS} is the name of the module. The PHP then inserts this line of code into the header.php file as many times as necessary to make up the main navigation.
Problem is, I can't seem to make Bootstrap's active state work for each nav item.
Suggestions?
- instrmntl0
Does it work if you rip it out of the php? Just thinking for debugging purposes.
- Continuity0
Haven't tried, but my gut says it wouldn't work, because stuff gets added to the base URL structure above, depending on stuff you click.
So, for example:
index.php?module=administration...or
index.php?module=calendar&action...
Etc.
I'm at a bit of a loss.
- mikotondria30
Not as familiar with Bootstrap as to fully understand what the 'active state' is, is it like, highlighting/styling of the nav item to help indicate which page you're on ?
If so, then couldn't you just use a php command to read the 'module=' part of the page url, and then trigger some jquery to amend the class of the nav item on the fly ?- Yeah highlighted nav. And I could ... if I was REALLY well-versed in PHP, which I'm not. :\Continuity