Yii Framework Forum: CMenu multiple submenu - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CMenu multiple submenu 2 layer horizontal menu Rate Topic: -----

#1 User is offline   sean2253 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 01-March 10

Posted 01 March 2010 - 12:49 PM

Can a 2 layer horizontal menu be created using CMenu? (Each link on the upper layer should render a different submenu.)

For me, the example the documentation produces the same submenu for each upper link, and the login link disappears.

Thanks Sean2253

-------------------------------------------
$this->widget('zii.widgets.CMenu', array(
'items'=>array(
array('label'=>'Home', 'url'=>array('site/index')),
array('label'=>'Products', 'url'=>array('product/index'), 'items'=>array(
array('label'=>'New Arrivals', 'url'=>array('product/new', 'tag'=>'new')),
array('label'=>'Most Popular', 'url'=>array('product/index', 'tag'=>'popular')),
)),
array('label'=>'Login', 'url'=>array('site/login'), 'visible'=>Yii::app()->user->isGuest),
),
));
--------------------------------------------
0

#2 User is offline   thyseus 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 299
  • Joined: 18-April 09
  • Location:Leipzig, Germany

Posted 01 March 2010 - 02:51 PM

Take a look at the 'NavBar'-Style of the superfish plugin:

http://users.tpg.com...erfish/#sample4

(click on 'Examples' after this url has been loaded)

It can easily be used within yii using the CDropDownMenu Extension.
This is a wrapper for the superfish plugin and can be set to 'navbar' style.
0

#3 User is offline   sean2253 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 01-March 10

Posted 01 March 2010 - 03:37 PM

Thanks Thyseus.

I will try this.


Sean2253.
0

#4 User is offline   sean2253 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 01-March 10

Posted 02 March 2010 - 05:05 AM

Thanks Thyseus.

However I do not want a menu that changes with/without hover.

I want each submenu to persist when its parent link is clicked.

I may have to do a hardcoded querystring based system?


Sean2253.
0

#5 User is offline   jonah 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 733
  • Joined: 27-November 08
  • Location:California (US)

Posted 02 March 2010 - 02:35 PM

http://www.yiiframew...eParents-detail

http://www.yiiframew...nu#items-detail
See the 'active' option

You're just going to have to mess around with the different options and the CSS
http://php-thoughts.cubedwater.com - my bloggings about Yii
0

Share this topic:


Page 1 of 1
  • 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