Yii Framework Forum: CMenu and multi-level nested menu - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

CMenu and multi-level nested menu Rate Topic: -----

#21 User is offline   Trejder 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,197
  • Joined: 06-October 10
  • Location:Southern Poland

Posted 13 September 2011 - 04:34 AM

arash,

View Postarash, on 09 September 2011 - 04:09 AM, said:

I did it, you can find it here
it's my first extension, so please comment on extension page whatever you think can make extension better

Thanks! However I'm not able to test it right know, as I'm not working on any new Yii project actively.

I'm planning to start a new one within next 3-4 months and I'll for sure test (use) your extension, as these menus looks great. But until that time you have to test it yourself or maybe other forum member will be willing to test it and post his/her comments here.

Thanks anyway for this extension and good luck! :]
Proud Cookbook author, though still learning powerful Yii! :] See my generic profile for more information. Cheers!
0

#22 User is offline   jowen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 191
  • Joined: 13-July 11
  • Location:Malaysia

Posted 30 October 2011 - 11:28 PM

Hi guys,

the Emenu extension work well, but url link only can show when user point exactly at the label text, not the label panel.

Great extension anyway, will try implement in my task. =)
0

#23 User is offline   Fixticks 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 31-May 11
  • Location:Uganda

Posted 28 November 2011 - 01:02 PM

View PostTrejder, on 02 November 2010 - 04:00 AM, said:

Here is Yii sample application with mentioned MBMenu used in place of original menu introduced by Yii.

Attachment mbmenu.zip

It is worth to note that MBMenu has some problems (menu drawing and handling bugs) when one is using menu with more than two sub levels. See 'Test' menu in attached example or try to reproduce this problem on your own site with using below code:

	<div id="mbmenu">
		<?php $this->widget('application.extensions.mbmenu.MbMenu',array
		(
			'items'=>array
			(
				array('label'=>'Home', 'url'=>array('/site/index')),
				array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),
				array('label'=>'Contact', 'url'=>array('/site/contact'), 'items'=>array
				(
					array('label'=>'A Sub in Contact'),
					array('label'=>'Very, very long menu item caption test...'),
				)),
				array('label'=>'Test', 'items'=>array
				(
					array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
					array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
					array('label'=>'Another very, very long menu item caption test...', 'items'=>array
					(
						array('label'=>'Sub Sub 1', 'url'=>array('/site/page', 'view'=>'about')),
						array('label'=>'Sub Sub 2', 'url'=>array('/site/page', 'view'=>'about')),
						array('label'=>'Sub Sub 2', 'url'=>array('/site/page', 'view'=>'about'), 'items'=>array
						(
							array('label'=>'Sub Sub Sub 1', 'url'=>array('/site/page', 'view'=>'about')),
							array('label'=>'Sub Sub Sub 2', 'url'=>array('/site/page', 'view'=>'about'), 'items'=>array
							(
								array('label'=>'Sub Sub Sub Sub 1', 'url'=>array('/site/page', 'view'=>'about')),
								array('label'=>'Sub Sub Sub Sub 2', 'url'=>array('/site/page', 'view'=>'about'))
							)),
						)),
					)),
				)),
			),
	    )); ?>
	</div>

Menu items for third, fourth and more levels is being incorrectly drawn (no top border) and all sublevels are being displayed at once when hovering mouse over second level menu item containing sub-level items.

MBMenu correctly handles menu items with two line captions and has some minor drawing issues with three or more lines in menu item captions.


so where do i dump that extracted mbmenu dir? #noob
A glass of water and 2 spoons of glucose makes the bugs go away
0

#24 User is offline   Funkamedic 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 15-February 12

Posted 15 February 2012 - 06:20 AM

View PostFixticks, on 28 November 2011 - 01:02 PM, said:

so where do i dump that extracted mbmenu dir? #noob

in protected/extensions
0

#25 User is offline   GambadiFerro 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 21-February 12

Posted 21 February 2012 - 03:33 PM

Hello I'm a newbie of Yii and PHP in general :lol:

Thank to your information I made my Yii Menu with multi-items!

I just modified this file [yiiProject]\protected\views\layouts\main.php

<?php  
  $baseUrl = Yii::app()->baseUrl;  
  $cs = Yii::app()->getClientScript();
  $cs->registerCoreScript('jquery.ui'); 
  $cs->registerCssFile($baseUrl.'/jqueryslidemenu/jqueryslidemenu.css');
  $cs->registerScriptFile($baseUrl.'/jqueryslidemenu/jqueryslidemenu.js');
?>


and I changed some lines for the widget

<div id="myslidemenu" class="jqueryslidemenu">
	<!-- <div id="mainmenu"> -->
		<?php $this->widget('zii.widgets.CMenu',array(
			'items'=>array
			(
                         ...
			),
		)); ?>
		<br style="clear: left" />
	</div><!-- mainmenu -->

0

#26 User is offline   Michael G 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 37
  • Joined: 10-February 12

Posted 04 July 2012 - 12:12 AM

View PostTrejder, on 28 October 2010 - 08:22 AM, said:

Quite good, heh? This one looks perfect! :)

I think you can post a new article on Yii Cookbook to publish it.

I'm uploading along with this post a zipped yii demoapp with included jqueryslidemenu. Hope someone will take a use of it.

Attachment jqueryslidemenu.zip

Thanks, again Antonio!


I'm using jquery 1.8. Are there any compatibility issues with this version of jquery? I ask because the jquery (jqslidermenu.js) was last updated in 2010.

Have you been using this approach on any production sites?

Thanks, Mike
0

#27 User is offline   rajesh chaurasia 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 12-January 13
  • Location:Mohali

Posted 20 March 2013 - 11:51 PM

dropdown menu


array('label'=>'Manage','dropdown' => true, 'url'=>'#', 'items'=>array
(
array('label'=>'name of level', 'url'=>array('/controller/action')),
array('label'=>'name of level', 'url'=>array('/controller/action')),
)),
this works fine.
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users