dynamic navigation and header |
[eluser]kpspoke[/eluser]
I am designing an intranet and i have a drop down navigation based off a database which displays different navigation items based on each users security level which is just a table field number. the html output of the current script is like the html below: <ul> <li>Parent <ul> <li>child</li> </ul> </li> </ul> table looks something like this: id:int, link_titletring, link_urltring, security_number:int, is_parent:bool, who_parent:int the parents and the children are variable depending on the users security group. My question is how would i implement this type of navigation to all my pages? Thanks in advance.
[eluser]JoostV[/eluser]
You can either implement is as an adjacency model or a nested list, which most people prefer. You will find an extensive description of both models here. [EDIT] doesn't perform well for very large lists.
[eluser]kpspoke[/eluser]
okay, that helps me with the query. How do i implement that header automatically on each page?
[eluser]JoostV[/eluser]
1. Create an array $data in all your controllers, to store all your data in. 2. Put your query inside a model pages.php. 3. Create a library navbar.php and fetch the navbar from pages.php into $CI->data['navbar']. 4. Autoload the library. |
Welcome Guest, Not a member yet? Register Sign In |