Welcome Guest, Not a member yet? Register   Sign In
Main navigation and sub navigation question
#1

[eluser]copernicus[/eluser]
I searched the site and couldn't find a concise answer to this so,

I have a site with a main navigation:
Home About Projects Contact

And some pages have a sub navigation under the main one, for example the About page has:
Home About Projects Contact
|
FAQ History etc...

How would I make it so it would appear to be a "child" of the about page? So the URL would be www.mysite.com/index.php/about/faq

All the pages are being pulled out of a database and I am using one main controller with a view template where the main content is being pulled from the DB.

Thanks
#2

[eluser]gstjohn[/eluser]
If I understand the question correctly, the simplest solution seems to be to have a controller named 'about' and a function within it named 'faq'. That should get you the desired URL.

Code:
class About extends Controller {
    function About() {
        parent::Controller();
    }
    
    // URL: http://www.somedomain.com/index.php/about -OR- http://www.somedomain.com/index.php/about/index
    function index() { ... }
    
    // URL: http://www.somedomain.com/index.php/about/faq
    function faq() { ... }
    
    ...
}
#3

[eluser]Sarfaraz Soomro[/eluser]
If the above is not what you want, may be you should take a look at URI Routing.
URI Routing




Theme © iAndrew 2016 - Forum software by © MyBB