Yii Framework Forum: Yiibooster Navbar & Html Anchors - Yii Framework Forum

Jump to content

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

Yiibooster Navbar & Html Anchors

#1 User is offline   Giles 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 21-June 13

Posted 16 November 2013 - 12:38 PM

Dear All

I'm using Yii-Booster navbar (which is brilliant). I now need to add anchors on some of my views. The only problem is that when my browser scrolls to the anchor, it's placing the anchor at the very top of the window (as below) which is basically placing it behind the NavBar!

Posted Image

I somehow need to offset it by the height of the NavBar. (I tried placing the NavBar above the body tag, to no avail). Here's my code ...

  <?php $this->widget('bootstrap.widgets.TbNavbar', array(
    'type'=>'inverse', // null or 'inverse'
    'collapse'=>true, // requires bootstrap-responsive.css

        // L/H menu

                // GUESTS
                array('label'=>'Log In', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
                array('label'=>'Contact', 'url'=>array('/site/contact'), 'visible'=>Yii::app()->user->isGuest),

                // USERS
                // browser
                array('label'=>'Browser', 'url'=>array('/browser'), 'visible'=>!Yii::app()->user->isGuest),
                // Subject
                array('label'=>'Subject', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest, 'items'=>array(                    
                    array('label'=>'View All Subjects', 'url'=>array('/subject')),
                    array('label'=>'View Subjects with new Entries', 'url'=>array('/subject')),
                // Entry
                array('label'=>'Entry', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest, 'items'=>array(
                    array('label'=>'New Entry', 'url'=>array('/entry/create')),
                    array('label'=>'Manage Entries', 'url'=>array('/entry/admin')),
                // Options
                array('label'=>'You', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest, 'items'=>array(
                    array('label'=>'Your Entries (Calendar View)', 'url'=>'#'),
                    array('label'=>'Your Entries (Journal View)', 'url'=>'#'),
                array('label'=>'Logout', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),

        // R/H menu
                // spare
                array('label'=>'Admin', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest, 'items'=>array(
                     // SubjectType
                     array('label'=>'Subject Type', 'url'=>'#','authItemName'=>'Administrator','visible'=>Yii::app()->user->checkAccess('Administrator'), 'items'=>array(
                        array('label'=>'Create', 'url'=>array('/SubjectType/create'),'authItemName'=>'Administrator'),
                        array('label'=>'Manage', 'url'=>array('/SubjectType'),'authItemName'=>'Administrator'),


I'd appreciate you help

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