Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting active to false has no effect in a Nav dropdown item #80

Open
kathysledge opened this issue Aug 30, 2015 · 0 comments
Open

Setting active to false has no effect in a Nav dropdown item #80

kathysledge opened this issue Aug 30, 2015 · 0 comments
Labels
status:ready for adoption Feel free to implement this issue.

Comments

@kathysledge
Copy link

As title says, it is not possible to eliminate a dropdown item from being active. You have to specify an absolute url. Documentation is not clear on the active attribute in this scenario, and it IS possible to set active to true.

echo Nav::widget([
    'options' => ['class' => 'navbar-nav navbar-right'],
    'activateParents' => true,
    'items' => [
        [
            'label' => 'Demo User',
            'url' => false,
            'visible' => !Yii::$app->user->isGuest,
            'items' => [
                [
                    'label' => 'My account',
                    'url' => ['account/overview'],
                    'active' => $controllerId == 'account', // This works
                ],
                [
                    'label' => 'Send feedback',
                    'url' => ['help/support/index'],
                    'active' => false, // This doesn't
                ],
                [
                    'label' => 'Logout',
                    'url' => ['login/logout']
                ],
            ],
        ],
    ],
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue.
Projects
None yet
Development

No branches or pull requests

2 participants