Yii Framework Forum: Bootstrap Nav Bar And Fb Icon - Yii Framework Forum

Jump to content

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

Bootstrap Nav Bar And Fb Icon Rate Topic: -----

#1 User is offline   Pabs 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 31-March 11

Posted 28 March 2014 - 02:15 PM

I'm using this widget for my navigation bar

bootstrap.widgets.TbNavbar

here's the actual code
<?php $this->widget('bootstrap.widgets.TbNavbar',array(
    'items'=>array(
        array(
            'class'=>'bootstrap.widgets.TbMenu',
            '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'=>'Registration', 'url'=>array('/cReg/create')),
                array('label' => 'Dropdown',
                   'items' => array(
                    array('label' => 'Item1', 'url'=>array('/site/contact')),
                    array('label' => 'Item2', 'url'=>array('/site/login')))

),
                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),
                
            ),
        ),
    ),
)); ?>



now, what I would like to do is have links to facebook and twitter on the right hand side of the nav bar.

can I simply add another array and substitute the label for an image and set it to a class that would shift it to the right? is that possible within the widget? I know you can set all the menu items to either go left or right with the by setting the class to 'pull-right' but not sure how to achieve what I want here

thanks
0

#2 User is offline   jcagentzero 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 14-October 11
  • Location:Philippines

Posted 28 March 2014 - 10:15 PM

Hi,

Give this a try
<?php $this->widget('bootstrap.widgets.TbNavbar',array(
    'items'=>array(
        array(
            'class'=>'bootstrap.widgets.TbMenu',
            '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'=>'Registration', 'url'=>array('/cReg/create')),
                array('label' => 'Dropdown',
                   'items' => array(
                    array('label' => 'Item1', 'url'=>array('/site/contact')),
                    array('label' => 'Item2', 'url'=>array('/site/login')))

),
                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('label'=>'facebook', 'url'=>'facebook.com', 'visible'=>true,'itemOptions'=>array('style'=>'right:0;position:fixed;', 'class'=>'facebook'),
            ),
        ),
    ),
)); ?>

Thank you and regards,

jcagentzero

http://www.jundycosmod.com

If you think this post is helpful, please don't hesitate to click + button.
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