Welcome Guest, Not a member yet? Register   Sign In
creating a navigation
#1

[eluser]Schumacher[/eluser]
ive asked once before but no one replied, and it might be because i asked in a wrong why.

so, my issue is that i want to structure my menu in a specefic way.
I would like to be able to make a 'active' class on the current page im on, so that it has a special class on it, but how do i get to know that this certain pageg is active? Before CI i just did the basename() and if that was it, it had a class on it.
But how do i do it with CI , in a smart way.
also if i would like to have more levels in my menu, so if im under lets say profile: then it shows
Profile
-edit text
-change password

and if im clicking on another page it goes for that page.

Anyone konw anything about that?

Plz let me know.
#2

[eluser]Crimp[/eluser]
One option:

1. Make your menu as a PHP view file to load as a partial view.
2. Set up conditionals based upon the URI segments to include and exclude menu items.
3. Set active class the same way - if segment 2 = profile and segment 3 = edit text, then set class = active.

It's actually quite easy to set up, and maintain, and works well if your app needs contextual navigation.




Theme © iAndrew 2016 - Forum software by © MyBB