Add Login-Form To A Dropdownlist In The Menu

Hi everybody,

here is my problem, I’m using bootstrap and I’m trying to add a login-form in a dropdown in my menu. Actually I’ve already done it this way:




<?php $this->widget('bootstrap.widgets.TbNavbar',array(

			'type'=> 'inverse', // null or 'inverse'

			'brand'=> CHtml::encode(Yii::app()->name),

			'brandUrl'=>'#',

    		//'collapse'=>true, // requires bootstrap-responsive.css

    		'items'=>array(

    			array(

    				'class'=>'bootstrap.widgets.TbMenu',

    				'htmlOptions'=>array('class'=>'pull-left'),


    				'items'=>array(

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

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

    					array('label'=>'Contact', 'url'=>array('/site/contact')),

    					/* Parte de administracion, solo visible cuando el admin se conecta */

    					array('label'=>'Usuarios', 'url'=>array('/usuario/index'), 'visible'=>!Yii::app()->user->isGuest),

    					array('label'=>'Discusiones', 'url'=>array('/discusion/index'), 'visible'=>!Yii::app()->user->isGuest),

    					array('label'=>'Topics', 'url'=>array('/topic/index'), 'visible'=>!Yii::app()->user->isGuest),

    					array('label'=>'Mensajes', 'url'=>array('/mensaje/index'), 'visible'=>!Yii::app()->user->isGuest),

    					/***********************************************/

    					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)

    					),

				),

				array(

					'class'=>'bootstrap.widgets.TbMenu',

					'htmlOptions'=>array('class'=>'pull-right'),

					'items'=>array(

						array('label'=>'Sign Up', 'url'=>'#'),

						'---',

						array('label'=>'Sign In', 

							'items'=>array(

								'htmlOptions'=>array('class'=>'dropdown-toggle',

									//HERE IS THE FORM 

									'template'=>'<form class="navbar-form pull-left" style="padding-left:15px;padding-right:15px;">

                                    <input type="text" class="span2" placeholder="Login">

                                    <input type="password" class="span2" placeholder="Password">

                                    <button type="submit" class="btn">Submit</button>

                                </form>'),

																

							)),

						),

					),

				),

				)); ?>



That’s how it shows:

The problem is that I’ve created a Portlet to make my life easier but, I am not able to put the login form there, is working perfectly outside the dropdown though.

Anybody knows how could I add the login-form ($this->widget(‘LoginFormPortlet’)) in the dropdown ?

I hope I have explained well my problem haha. Thank u in advance !

cheers.

Does this no work?





'items'=>array(

             'htmlOptions'=>array('class'=>'dropdown-toggle',

             //HERE IS THE FORM 

             'template'=>$this->widget('LoginFormPortlet',array(),true), //return widget output

...



Hi Joblo, thank you for the reply ! It’s working now, I was doing it the wrong way haahha thx aloot !

cheers! ^^