CMenu childrens


Does CMenu childrens work by default?

I have this code in main.php

		<?php $this->widget('zii.widgets.CMenu',array(


				array('label'=>'Home', 'url'=>array('/site/index')),

                                array('label'=>'Game archive', 'url'=>array('/game/index')),

                                array('label'=>'Most popular', 'url'=>array('/game/index', 'Game_sort'=>'rating.desc')),

                                array('label'=>'Genres', 'url'=>array('/game/genre', 'genre'=>'Puzzle'), 'items'=> array(



                                        'url'=>array('/game/genre', 'genre'=>'Adventure')




                                        'url'=>array('/game/genre', 'genre'=>'Action')



                                array('label'=>'Suggest game', 'url'=>array('/game/create')),

				array('label'=>'Contact', 'url'=>array('/site/contact')),

				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)


		)); ?>

And it gives me this menu:

For menu items after the children, I actually have to hover them for them to show (see Suggest game)

So, is this supposed to work by default or will I have to modify css?


maybe I don’t understand your question right.

I would say, you have to change the css file.

Maybe this threat will help you:

CSS Menu

You need only a few minutes to test it.

Hope, that helps.


No, that’s not what I mean. As you can see is Genres and Suggest game on different rows, and by looking at the code you can see that that shouldn’t be the case.

Yes I understand it. I had the same problem using the example in the guide. IMHO it is a CSS think.

My example is much more complex, but the main idea should be the same: you have to update the css file.