Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Specify Parent for Menu
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Specify Parent for Menu
#28932
Specify Parent for Menu 12 Years, 1 Month ago Karma: 0
Are there any plans or has anyone done a hack to allow for the specification of a parent item to display a subset of a menu as a menu module? When someone selects a particular center, I want to display a separate module that shows the child items for that center. Currently, I have to create a separate menu of alias items to support this, I would prefer to just point to the main menu and start the submenu at the appropriate parent id. The site is www.pacecenter.org.
The administrator has disabled public write access.
 
#28941
Re:Specify Parent for Menu 12 Years, 1 Month ago Karma: 748
Hello,

The module works as standard Joomla! menu module and it shows menu created in Joomla! menu manager.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#28995
Re:Specify Parent for Menu 12 Years ago Karma: 0
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.
File Attachment:
File Name: mod_ariextmenu_patch.zip
File Size: 7471
The administrator has disabled public write access.
 
Go to topPage: 1