deli6z
(Deli6z)
March 22, 2013, 3:27am
1
Hi everybody. I’m new to yii so please don’t judge.
I’m trying to figure CMenu and setting a lastItemCssClass to the main menu. Although it gets set to the sub menu last item as well what is not expected. Is there a way to prevent this behaviour?
Thank you for response in advance!
seenivasan
(Chellamnivas)
March 22, 2013, 11:10am
2
Dear Friend
Rather than assigning a class to the property lastItemCssClass , we can manually declare it in itemOptions .
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')),
),'itemOptions'=>array("class"=>"last")),
deli6z
(Deli6z)
March 23, 2013, 1:40am
3
seenivasan:
Dear Friend
Rather than assigning a class to the property lastItemCssClass , we can manually declare it in itemOptions .
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')),
),'itemOptions'=>array("class"=>"last")),
Thank you for help, that worked! Since it’s related there is another question: how to set a class for <ul> element? Actually submenu’s one. Thank you!!!
seenivasan
(Chellamnivas)
March 24, 2013, 6:11am
4
Dear Friend
You can declare the submenuOptions in main item .
deli6z
(Deli6z)
March 24, 2013, 8:30pm
5
both itemOptions and submenuOptions are described in official documentation but I,somehow, missed it, my bad guys!
Thanks for help!