CodeIgniter Forums

Full Version: How to make a good navigation ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Diti[/eluser]
Good afternoon guys,

I was reading the article « Où suis-je », a translation of the Alistapart's “Where am I ?” when I wondered if CI is able to satisfy that :
Quote:Building in a lot of if/then statements to change the links per page takes some extra time. But it’s so worth it. Simply changing a global navigation item to be plain old text when you’re on that page means that it will look different (visual recognition of your present place) and will avoid the click-to-go-to-where-you-already-are bad experience.

Is that possible to follow all navigation principles thanks to CodeIgniter ?
My site follows the Derek Allard's sample website in coding techniques.

Oh, and could you read that : http://alistapart.com/articles/keepingcurrent Smile ?

Thanks.
Diti.

El Forum

[eluser]kgill[/eluser]
First may I offer a pointer:
If you want help with something, don't post links and say read this so you can help me. Most of us don't have the time to do extra reading. Instead, try and summarize what it is you want to do and need help with.

Since I read a list apart I happen to know what you're talking about - and the answer is: only if you make it.

The articles are about generic concepts to use in your display logic - so yes it's possible with CI but then it's possible with just about any web language/framework. CI is a programming framework, not a drop in solution - how a site ends up looking and working is entirely up to the person coding the models, views and controllers. While CI has built-in helpers to make common stuff easier, something like customizing the way your links display in your views is most definitely in the realm of the developer/designer and not the framework itself.

As for how to do it, the most basic would be to pass the name of the current controller to the view and have an if statement for each link to see if it should display the current page plain text version or the linked version. Alternatively, you could pass the nav elements in an array and handle it in a loop, use views within views, etc. How you choose to implement it is a matter of personal preference.

- K