Ok all, I have really been racking my brain on this one as I am really excited about EE2 and trying to learn the proper way to structure what I am trying to do. So bare with me!
I have a site that will have main navigation that will be static for the top level navigation and under each top level item, it will list sub pages that I want to be dynamic. Like so:
Main Section 1
-> Sub Main Section 1
-> Sub Main Section 2
Main Section 2
-> Sub Main Section 1
-> Sub Main Section 2Etc. I want to use 1 “subpage” template that embeds a sub navigation template in it. This subpage template will be the template that all sub pages use as they do not change.
If I click on main section 1, I want the sub nav to display all of the sub main sections and nothing else.
Sounds simple? ehem. I understand (I think) the concept of how it should work, and I do this all the time in CodeIgniter, I just think I am missing something in the picture doing this within EE2.
I am using the pages module, and in each page that I add, I add the Pages URI like so:
/main_section_1/ (root page of section)
/main_section_1/sub_main_section_1/
/main_section_1/sub_main_section_2/Etc. The templates main links are hard coded using the ee paths etc. So I can get to http://localhost/sitename/index.php/main_section_1/ just fine. I can also get to http://localhost/sitename/index.php/main_section_1/sub_main_section_1/ just fine as well (using nested urls).
The problem is getting the subnav to only display pages that belong to it’s section and not displaying the root /main_section_1/ in the sub navigation.
My subnav should only output the 2 subpages. I have tried categories and everything else and just cannot seem to get it to work. What is the best way to handle this? I really don’t want to have a channel for each “main section” and really don’t want to have a template group setup for each main section either.
Am I going about this wrong? Thanks in advance for any help you all have to offer!