Hello!
Is there somewhere a concise and precise definition of the following variables of the menu_manager module, or could someone of you give it:
current ( the lowest node in the menu path? )
parent ( difference to 'haschildren' ? )
children_exist ( difference to 'parent' ? )
Somewhere I got
has_children
which is deprecated, is it?
Thanks very much.
[solved] Exact definitions of some menu_manager variables
[solved] Exact definitions of some menu_manager variables
Last edited by dlen on Sun Dec 29, 2013 1:43 am, edited 2 times in total.
Re: Exact definitions of some menu_manager variables
I would assume that a menu is a representation of a tree with nodes, so that:
- Current is the current active node/page;
- parent: if is not on the root then it has to have a parent, so this is it;
- haschildren: well... it has to be TRUE if the current node does have children...
- Current is the current active node/page;
- parent: if is not on the root then it has to have a parent, so this is it;
- haschildren: well... it has to be TRUE if the current node does have children...
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Exact definitions of some menu_manager variables
Thanks for your thoughts.
The problem is,
"current" could be defined as true when the link belongs to the open page - or when the link belongs to the open page AND the page has no children (Though probably is not - but I want to get away from this "probably"- thing.)
"parent" could be defined as true, when it has children at all - or when it has children and the open page is one of them.
"children_exist" should be clear, but again there is this "should".
More generally, I'd like to suggest to module writers to document not only the parameters, but also the available variables in the module documentation.
The problem is,
"current" could be defined as true when the link belongs to the open page - or when the link belongs to the open page AND the page has no children (Though probably is not - but I want to get away from this "probably"- thing.)
"parent" could be defined as true, when it has children at all - or when it has children and the open page is one of them.
"children_exist" should be clear, but again there is this "should".
More generally, I'd like to suggest to module writers to document not only the parameters, but also the available variables in the module documentation.
Re: Exact definitions of some menu_manager variables
Actually I wasn't clear on my answer, parent holds (I think) the id of the parent and not if current is parent as that would not make sense. However keep in mind that any non 0/null/empty variable is considered as being true on a {if $var} type of test, hence the other tests possible (isset() for instance).dlen wrote:"parent" could be defined as true, when it has children at all - or when it has children and the open page is one of them.
I have to admit I'm not that experienced with menu manager but test what is available on each var with {$var|print_r} on each case. It's an invaluable tool for this.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: Exact definitions of some menu_manager variables
Have you read Menu Managers Help page..?
Re: Exact definitions of some menu_manager variables
I must have been blind.