protected/componentsSee the following code example:
$this->widget('application.components.JQuerySlideTopMenu.JQuerySlideTopMenu', array( 'items'=>array( array('label'=>'Home', 'url'=>array('site/index')), array('label'=>'WIKI', 'url'=>'#', 'subs'=>array( array('label'=>'New article', 'url'=>'#'), ), 'visible'=>!Yii::app()->user->isGuest), array('label'=>'Blog', 'url'=>'#', 'subs'=>array( array('label'=>'New post', 'url'=>'#'), ), 'visible'=>!Yii::app()->user->isGuest), array('label'=>'Admin tools', 'url'=>'#', 'subs' => array( array('label'=>'Users', 'url'=>'#', 'subs' => array( array('label'=>'Add new user', 'url'=>array('auth.users/create')), array('label'=>'List', 'url'=>array('auth.users/list')), )), array('label'=>'Customers', 'url'=>'#', 'subs' => array( array('label'=>'Add new', 'url'=>'#'), array('label'=>'List', 'url'=>'#'), )), array('label'=>'Projects', 'url'=>'#', 'subs' => array( array('label'=>'Add new', 'url'=>'#'), array('label'=>'List', 'url'=>'#'), )), array('label'=>'Accounting setup', 'url'=>'#', 'subs' => array( array('label'=>'Employees', 'url'=>'#'), array('label'=>'Bank accounts', 'url'=>'#'), array('label'=>'Settings', 'url'=>'#'), )), array('label'=>'Roles & Permissions', 'url'=>'#'), array('label'=>'Settings', 'url'=>'#'), ), 'visible'=>!Yii::app()->user->isGuest), array('label'=>'My profile', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest), array('label'=>'Login', 'url'=>array('site/login'), 'visible'=>Yii::app()->user->isGuest), array('label'=>'Logout', 'url'=>array('site/logout'), 'visible'=>!Yii::app()->user->isGuest) ), ));
Total 10 comments
follow comments mitoasoy and use the instructions, I had the same problem, I already logged in when i mouseover on "admin tools", sub menu (including image down.gif) still does not work submenu doese not showing, anyone give me solution, Thanks
In reply to Luiz:
to get url with options working, would be enough to replace
by
In reply to mitoasoy
These menus aren't visible to guest users, so You must login to see them or just comment out the lines
It's Great menu I Like It
the following command (link with 'view' option) not working properly:
So I had to make some changes in code:
this is correct?
Hi Guys,
I put main.css inside CSS folder (replacing current main.css) and i put JQuerySlideTopMenu folder inside protected/components (so it become protected/components/JQuerySlideTopMenu/JQuerySlideTopMenu.php Then i copy php code in this JquerySlideTopMenu documentation (http://www.yiiframework.com/extension/jqueryslidetopmenu/#doc) replacing my current menu in protected/views/layouts/main.php
But when i run my Yii Application in browser, why did the menu become only Home and Login?it seems like the other menu which has submenu didn't work and did'nt even showed up.
Somebody help me pleaseeeee....
nyto,
I also have the same problem, and I have found main.css conflicts with jqueryslidemenu.css in #mainmenu like following:
In my case, just removing above line is enough. You can explore css files using firebug or other extension with ease.
Guys, this menu is using unchanged dynamicdrive code so this is definitely not the extension bug. I think you are trying it with default Yii testdrive application? So there seems to be a conflict with default Yii css styles... I will upload main.css file that works for me.
Yeah.. I have the same problem like henqi..
Waiting for update..
I need to add this code
in 2 files in both JQuerySlideTopMenu.php and view.php to avoid yii complain the error/warning
is undefine index.
After fixed, the top menu appeared, but it behave incorrectly as shown at dynamicdrive dot com, the space between each menuitem seems like too width, when mouse hover over to next bottom menuitem, the menu behave like mouse already move out, and simply disappeared.
Can you please help and comment ?? I still new to Yii, and first to MVC framwork.
Leave a comment
Please login to leave your comment.