Hodges
(Dev)
April 9, 2013, 4:11am
1
The topic kind of says what I’m trying to get to. So for example if have this:
$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),
),
));
Is there a way to make the top-level ‘Products" menu item un-selectable. In instance the Products top-level is just a label for the items that sit below and shouldn’t do anything. Cant’ seem to figure out how to make this work this way.
Much appreciate your help with this.
–
Chris
hiral23790
(Hiraldarji237)
April 9, 2013, 5:07am
2
The topic kind of says what I’m trying to get to. So for example if have this:
$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),
),
));
Is there a way to make the top-level ‘Products" menu item un-selectable. In instance the Products top-level is just a label for the items that sit below and shouldn’t do anything. Cant’ seem to figure out how to make this work this way.
Much appreciate your help with this.
–
Chris
As per I understand your problem you want to remove product as a link,
so for that cchange you product menu like this,
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('id'=>'product')),
and in your this view file on top write following script
<script>
$(document).ready(function () {
$('#product a').click(function(){
return false;
});
});
</script>
Hodges
(Dev)
April 9, 2013, 3:17pm
3
That’s what I was looking for. Thanks so much!
As per I understand your problem you want to remove product as a link,
so for that cchange you product menu like this,
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('id'=>'product')),
and in your this view file on top write following script
<script>
$(document).ready(function () {
$('#product a').click(function(){
return false;
});
});
</script>