[eluser]carlhussey[/eluser]
Hey guys, I'm new to codeigniter and slowly figuring things out as I go along.
I have a template I'm building my site around and it has a menu structure in it that im trying to populate based on certain information.
Here is the layout of the menu.
Code:
<ul id="main-nav"> <!-- Accordion Menu -->
<li>
<a Xref="home" class="nav-top-item no-submenu"> <!-- Add the class "no-submenu" to menu items with no sub menu -->
Dashboard
</a>
</li>
<li>
<a Xref="#" class="nav-top-item current"> <!-- Add the class "current" to current menu item -->
News / Updates
</a>
<ul>
<li><a Xref="#">Whats Crackin'?</a></li>
<li><a Xref="#">Reminders</a></li>
<li><a class="current" Xref="#">Calander of Events</a></li> <!-- Add class "current" to sub menu items also -->
</ul>
</li>
<li>
<a Xref="#" class="nav-top-item">
Schedule
</a>
<ul>
<li><a Xref="#">View Current Schedule</a></li>
<li><a Xref="#">View Past Schedules</a></li>
<li><a Xref="#">Request Time Off</a></li>
</ul>
</li>
The part that im stuck on is the fact that the menu is shown in a certain way depending on the page they are on. There are main categories and then sub links in that category
If i were to click on News and Updates, then the class would be class="nav-top-item current"
Then, the sub link that is clicked on would contain <a class="current">
Basically, the class in the view changes depending on the page they are on.
I'm guessing that will be done by checking the url to see what the controller is and going from there.
Any advice on this, this was confusing im sure.
Side note.. in my code the Xref is just because im new and the site is dumb and wont allow a link in a code view..