I'm having issues getting a submenu for my pages to work correctly. Here's my page structure:
Top Level Page 1
- Sub Page
- Sub Page
- Bottom Level Page
- Bottom Level Page
- Sub Page
- Sub Page
- Bottom Level Page
- Bottom Level Page
- Bottom Level Page
Top Level Page 2
- Sub Page
- Sub Page
- Bottom Level Page
- Bottom Level Page
- Sub Page
- Sub Page
- Bottom Level Page
- Bottom Level Page
- Bottom Level Page
Top Level Page 3
- Sub Page
- Sub Page
- Bottom Level Page
- Bottom Level Page
- Sub Page
- Sub Page
- Bottom Level Page
- Bottom Level Page
- Bottom Level Page
If the user is on the top level, I want it to display the children (but NOT grandchildren) - including the title page you're on (at the top).
If the user is on a Sub Page, I want it to display the children - with the parent at the top of the list.
If the user is on a bottom level page (grandchild), I want it to display it's siblings with it's parent and grandparent at the top.
So far I've managed to get about 60% of the functionality correct but I get the feeling I'm re-inventing the wheel. Has anyone done something like this in the past?