Elxis CMS Forum

Support => Elxis 4.x/5.x DEV => Topic started by: acampball on September 22, 2014, 07:29:08

Title: Expand opportunities menu.
Post by: acampball on September 22, 2014, 07:29:08
Wanted to ask for an opportunity to increase the menu for the other components to create their own links to the component. Just as done for Content - Link to category or article.

Or add the ability to choose the module as a sub-menu.
Title: Re: Expand opportunities menu.
Post by: datahell on September 23, 2014, 08:54:43
This is already supported. You can build custom auto-expandable menus for frontend and backend area.

If your component is named "something" then create tis file:

components/com_something/something.menu.xml

Write inside it (to create a backend menu):

<elxismenu component="something">
      <backend>
            <menu name="default">
                  <title lang="en">Something</title>
                  <title lang="el">Κάτι</title>
                  <items>
                        <item type="link" link="something:/" file="" popup="0" secure="0" target="_self">
                              <title lang="en">Control panel</title>
                              <title lang="el">Πίνακας ελέγχου</title>
                        </item>
                        <item type="link" link="something:categories/" file="" popup="0" secure="0" target="_self">
                              <title lang="en">Categories</title>
                              <title lang="el">Κατηγορίες</title>
                        </item>
                        <item type="link" link="something:categories/add.html" file="" popup="0" secure="0" target="_self">
                              <title lang="en">New category</title>
                              <title lang="el">Νέα κατηγορία</title>
                        </item>
                  </items>
            </menu>
      </backend>
</elxismenu>

item type can be link, url and separator
An item can have a sub-menu.
XML attributes supported for the item tag: type, file, popup, secure, target, ordering, expand, width, height, icon, link, alevel, gid, uid
XML menus get parsed by the elxisXMLMenu library.

elxisLoader::loadFile('includes/libraries/elxis/menu.xml.php');
$xmenu = new elxisXMLMenu(null);
$xmlmenus = $xmenu->getAllMenus('something', 'backend');


In module "admin menu" the parameter "expand components" must be Yes for the custom menus to be displayed.
Title: Re: Expand opportunities menu.
Post by: acampball on September 24, 2014, 14:48:30
I'm interested in the menu for frontend!

How to make links to dynamic categories of my components?
Category added by users
Title: Re: Expand opportunities menu.
Post by: datahell on September 24, 2014, 18:22:13
The standard built-in menu supports the built-in components. For third party components you can only expand it via XML as I show you before. To expand it dynamically from database you need to build your own menu module.