Failure

User tests: Successful: Unsuccessful:

avatar phproberto
phproberto
25 Feb 2013

Backend menus markup was not overridable.

I moved the JMenuNode (that was inside the administrator mod_menu) to the cms library and improved it to manage attributes. This way the library is available for every extension.

I also added JLayouts for the common used bootstrap menus:

  • dropdown
  • tabs
  • tabs-stacked
  • pills
  • pills-stacked
  • list

Also created two joomla basic menu layouts.

Now administrator mod_menu default layout displays:

$layout = new JLayoutFile('bootstrap.menu.dropdown');
echo  $layout->render($menu);

That file can be easily overriden for example in hathor to use:

$layout = new JLayoutFile('joomla.menu');
echo  $layout->render($menu);

Anywhere in the site we now can display a menu.

Sample menu creation

$menu = new JMenuParent;
$submenu = new JMenuNode('Hello world', 'index.php');
$submenu->addChild(new JMenuNode('Hello2 world', 'index.php'));
$submenu->addChild(new JMenuNode('Hello3 world', 'index.php'));
$menu->addChild($submenu);
$menu->addChild(new JMenuNode('Hello4 world', 'index.php'));

$layout = new JLayoutFile('bootstrap.menu.tabs');
echo  $layout->render($menu);
avatar phproberto phproberto - open - 25 Feb 2013
avatar mbabker
mbabker - comment - 26 Feb 2013

My only complaint about this is that we lose the possibility to use icons in Hathor's menu again (this came back after a recent commit). Aside from that, it looks great and I'm not seeing any loss of functionality.

Since we're moving classes to the CMS libraries, would it be possible to throw together some quick unit tests? Not a show stopper to me, but I'd like to improve our test coverage as we go :smile:

avatar phproberto
phproberto - comment - 26 Feb 2013

Thanks for reviewing it Michael!

As I want to do this in the right way I'll search the hathor icons and learn about unit tests before add a tracker item for this.

avatar nicksavov
nicksavov - comment - 4 May 2013

Hi Roberto,

What's the status on this one? Looks like it's still in sync with master, surprisingly :)

avatar brianteeman
brianteeman - comment - 13 Oct 2013

Please can you create a corresponding joomlacode tracker item for this - thanks

avatar phproberto
phproberto - comment - 11 Jun 2014

I'm closing this hoping to be able to contribute it again in the future.

avatar phproberto phproberto - close - 11 Jun 2014

Add a Comment

Login with GitHub to post a comment