I understand, I was looking to see if anyone had expanded the functionality. I went ahead and took a crack at it. I have changed the module to accept a "StartParent" parameter which is the ID of the sub-menu item you wish to start with. The module will then only display the children, grand-children etc. of this parent. This is useful if you want just the children items to display while you are under that parent. To implement this, I made the following changes:
Added STARTPARENT to xml file mod_ariextmenu/mod_ariextmenu.xml
Code: |
<field name="startParent" type="text" default="0" label="AEM_PARAM_STARTPARENT_LABEL" description="AEM_PARAM_STARTPARENT_DESCR" />
|
Added labels to Language file language/en-GB/en-GB.mod_ariextmenu.ini
Code: |
AEM_PARAM_STARTPARENT_LABEL="Start parent"
AEM_PARAM_STARTPARENT_DESCR="Specify start parent of the menu. Set this parameter to the ID of the parent for this menu. Module will show all of this parents descendants. Set this parameter to '0' if you want to start from root menu node"
|
mod_ariextmenu/tmpl/default.php (add menuStartParent and parent parameter to AriTemplate::display call)
Code: |
'menuStartParent' => $menuStartParent,
'parent' => $parent
|
mod_ariextmenu/mod_ariextmenu.php after line 26 (add initialization of menuStartParent and set parameters for first iteration)
Code: |
/*Set parameters if $menuStartParent is set
* Set Parent to StartParent if set else to 1
* Set menulevel to parent's level +1
*/
$menuStartParent = intval($params->get('startParent'));
if ($menuStartParent != 0)
{
$parent = $menuStartParent;
$StartParentMenuItem = $menu->getItem($parent);
$menuLevel = $menuStartLevel = $StartParentMenuItem->level + 1;
}
else
{
$parent = 1;
}
|
I hope someone will find this useful. I've never made a patch but I zipped the 4 files I changed into the attached.