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

Navbar brandLabel custom html #101

Open
rubenheymans opened this issue Dec 31, 2015 · 5 comments
Open

Navbar brandLabel custom html #101

rubenheymans opened this issue Dec 31, 2015 · 5 comments
Labels
type:enhancement Enhancement

Comments

@rubenheymans
Copy link

yii\bootstrap\Navbar R120

if ($this->brandLabel !== false) {
    Html::addCssClass($this->brandOptions, ['widget' => 'navbar-brand']);
    echo Html::a($this->brandLabel, $this->brandUrl === false ? Yii::$app->homeUrl : $this->brandUrl, $this->brandOptions);
}

Is it possible to add an option to just print the brandLabel?
Now I can render a view with custom html

NavBar::begin([
    'options'    => [
        'class' => 'navbar navbar-default',
        'id'    => 'nav-first',
    ],
    'brandLabel' => Yii::$app->view->render('_brandLabel'),
]);
@cebe
Copy link
Member

cebe commented Dec 31, 2015

what do you mean with "just print the brandLabel"?

@SilverFire
Copy link
Member

I guess @rubenheymans don't want the <a href=".."> tag

@rubenheymans
Copy link
Author

yes what @SilverFire said
now there will always be an a tag wrapped around my content in the _brandLabel.php view

@SilverFire SilverFire added the type:enhancement Enhancement label Jan 5, 2016
@SilverFire SilverFire added this to the 2.0.7 milestone Jan 5, 2016
@klimov-paul
Copy link
Member

This one can not be resolved without BC break as false and null values of the brandLabel are already processed in thier own way.
We may consider removal of 'a' tag rendering on brandLabel equals to null, however it may break markup existing projects.

@samdark
Copy link
Member

samdark commented Jan 15, 2019

Fixed in bootstrap 4. For v3 it could be fixed as well but in a major release 2.1.

@samdark samdark removed this from the 2.1 milestone Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

5 participants