How to combine 3 pictures into CMenu

Hi All,

I have problem to put three pictures into CMenu. I have three different picture which is left tab, middle tab and right tab. The combination of three picture becomes one button tab. The reason of separation of three picture istead of one picture is because I need to change the different language of text easily by just changing for the respective text only without concerning about the pictures. Another reasons will be able to auto adjusted with the scale of the middle picture according to the size of the text to be inputted. Therefore, that is the reason of spliting the one button tab into three different tab.

I have tried to put one button tab pictures instead of three tab pictures, it allows to insert but when it can not auto resize the length of the text to be inputted. Therefore, it is consider one of the problem. I hope anyone can help me to solve with this problem.

I hope attached with the sample of the tab picture for view purposes.

Thanks you.

Best Regards,

Asiagis

Hi anyone,

Can anyone help me on this problem?

Thanks you very much.

Best Regards,

Asiagis

As an item for the CMenu you need to pass HTML ( using http://www.yiiframework.com/doc/api/CMenu#itemTemplate-detail I think ). And your HTML should be something like that:


<div class="left"></div>

<div class="middle">{menu}</div>

<div class="right"></div>

for example:


<div id="mainmenu">

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

		'itemTemplate'=>'<div class="left"></div><div class="middle">{menu}</div><div class="right"></div>',

		'items'=>array(

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

			array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),

			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)

		),

	)); ?>

</div>

and one item of the list is:


<li class="active"><div class="left"/><div class="middle"><a href="/timepicker/index.php?r=site/index">Home</a></div><div class="right"/></li>