I'm very close to finishing a menu that I've struggled with for a very long time. I have a menu something like this
1.1
1.2
1.3
2.1
2.2
3.1
3.2
3.3
3.4....
Is there any way to check with a {if} statement if a page is the last child in a menu?
Basically I want to close a div when I hit the last page in a sub list. In this instance 1.3, 2.2, 3.4.
I open the div whenever there is a new parent, but need to close it after the last child.
Check for last chilld in menu.
-
- Forum Members
- Posts: 43
- Joined: Thu Mar 13, 2008 8:16 pm
Re: Check for last chilld in menu.
Check... http://forum.cmsmadesimple.org/index.ph ... #msg152295
There is logic there that checks if a level hits the last element...
Ronny
There is logic there that checks if a level hits the last element...
Ronny
-
- Forum Members
- Posts: 43
- Joined: Thu Mar 13, 2008 8:16 pm
Re: Check for last chilld in menu.
Thanks,
Although for some reason it doesn't seem to be working quite right for me. I tried
Just to see if the text would show up in my menu (Previous and Next). For some reason, 'Previous' shows up (after each item) "next" never shows. Any ideas? (I tried this instead of the because the menu wasn't being generated correctly).
Although for some reason it doesn't seem to be working quite right for me. I tried
Code: Select all
{$cgsimple->get_sibling("prev","prev_sibling")}{if !empty($prev_sibling)}{cms_selflink page="$prev_sibling" text="Previous"}{/if}
Code: Select all
{$cgsimple->get_sibling("next","next_sibling")}{if !empty($next_sibling)}{cms_selflink page="$next_sibling" text="Next"}{/if}
-
- Forum Members
- Posts: 43
- Joined: Thu Mar 13, 2008 8:16 pm
Re: Check for last chilld in menu.
I actually got this working with the menu (section expand) that I was modifying. I went about it in a slightly different way.