Welcome Guest, Not a member yet? Register   Sign In
dynamic navigation and header
#1

[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_titleConfusedtring, link_urlConfusedtring, 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.
#2

[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.
#3

[eluser]kpspoke[/eluser]
okay, that helps me with the query. How do i implement that header automatically on each page?
#4

[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.




Theme © iAndrew 2016 - Forum software by © MyBB