Yii Framework Forum: How to combine 3 pictures into CMenu - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to combine 3 pictures into CMenu CMenu implementation Rate Topic: -----

#1 User is offline   asiagis 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 10-June 10

Posted 19 July 2010 - 09:17 PM

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

Attached File(s)

  • Attached File  tab.zip (16.25K)
    Number of downloads: 8

0

#2 User is offline   asiagis 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 10-June 10

Posted 25 July 2010 - 08:28 PM

Hi anyone,

Can anyone help me on this problem?

Thanks you very much.

Best Regards,
Asiagis
0

#3 User is offline   frantic 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 172
  • Joined: 01-March 10
  • Location:Saint-Petersburg

Posted 25 July 2010 - 09:06 PM

As an item for the CMenu you need to pass HTML ( using http://www.yiiframew...Template-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>

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users