mini998
(Ima Silva)
1
Hi total newbie here
I need to generate the following html code
[b]<ul class="social">
<li><a href="index.html" title="vimeo icone"></a></li>
<li><a href="index.html" title="linkedin icone"></a></li>
<li><a href="index.html" title="twitter icone"></a></li>
</ul>[/b]
But I can figure out how to create ‘class’ and ‘title’ with Cmenu widget.
any help is appreciated
Hi and welcome
See here: http://www.yiiframework.com/doc/api/1.1/CMenu#items-detail
If you’re stuck, you’d better paste your CMenu rendering code please (and why not, the expected output).
mini998
(Ima Silva)
3
I am using this
[b]<?php $this->widget(‘zii.widgets.CMenu’,array(
'items'=>array(
array('label'=>'', 'url'=>array('/index')),
array('label'=>'', 'url'=>array('/property')),
array('label'=>'', 'url'=>array('/contact')),
),
)); ?>
[/b]
it generates
[b]<ul id="yw1">
<li><a href="/ehouse/index.php"></a></li>
<li><a href="/ehouse/index.php"></a></li>
<li><a href="/ehouse/index.php"></a></li>
</ul> [/b]
I need to generate something like this
[b]<ul id="CustumName">
<li><a href="/ehouse/index.php" title="one" ></a></li>
<li id ="SecondItem"><a href="/ehouse/index.php" title="one" ></a></li>
<li><a href="/ehouse/index.php" title="one" ></a></li>
</ul>[/b]
Thanks
antokara
(Antokarag)
4
What you need is here:
http://www.yiiframework.com/doc/api/1.1/CWidget#id-detail
and here:
http://www.yiiframework.com/doc/api/1.1/CMenu#htmlOptions-detail
Example:
<?php $this->widget('zii.widgets.CMenu',array(
'items'=>array(
array('label'=>'', 'url'=>array('/index')),
array('label'=>'', 'url'=>array('/property')),
array('label'=>'', 'url'=>array('/contact')),
),
'id'=>'CustomName',
'htmlOptions'=>array('class'=>'social'),
)); ?>
If that helped you, please vote (+) on my post.
Following the link I gave you above:
$this->widget('zii.widgets.CMenu',array(
'items'=>array(
array('label'=>'', 'url'=>array('/index'), 'linkOptions'=>array('title'=>'one')),
array('label'=>'', 'url'=>array('/property'), 'itemOptions'=>array('id'=>'SecondItem'), 'linkOptions'=>array('title'=>'one')),
array('label'=>'', 'url'=>array('/contact'), 'linkOptions'=>array('title'=>'one')),
),
'id'=>'CustumName', // Antonis gave you this one
));
mini998
(Ima Silva)
6
Thanks a lot for both of you.
I cant seem to give away any rep for anyone .Maybe since I’m new ?