Yii2: breadcrumbs separator

Created on 15 Sep 2013  路  5Comments  路  Source: yiisoft/yii2

Hi.

Why you haven't added var to describe breadcrumbs separator? As is in yii1 $separator

https://github.com/yiisoft/yii2/blob/master/framework/yii/widgets/Breadcrumbs.php#L118

Most helpful comment

bootstrap does it with css:

.breadcrumb > li + li:before {
    color: #ccc;
    content: "/ ";
    padding: 0 5px;
}

screenshot-2014-12-15t22 26 22

All 5 comments

You can adjust the template and tag to add separator.

@cebe, how do you suggest to adjust a template?
If you configure it as ['itemTemplate'=>"<li>{link}</li> _my_separator_ \n"] it will touch last element, where separator is not needed. The same situation is when you add it in a beginning.
And after all you should change "activeItemTemplate" too - so it will be a duplicate.

As i see, only solution is to override whole class, add $separator variable and use it in implode function...
Or may be i miss something obvious?

bootstrap does it with css:

.breadcrumb > li + li:before {
    color: #ccc;
    content: "/ ";
    padding: 0 5px;
}

screenshot-2014-12-15t22 26 22

But won't it be easer just to specify a property than a whole css selectors in case of own design?

No.

Was this page helpful?
0 / 5 - 0 ratings