Commit 74873101b2cdc8a9a33b830e2e887c56ed1b86a3
1 parent
3f44ed5a
Breadcrumbs fix?
Showing
2 changed files
with
7 additions
and
5 deletions
Show diff stats
frontend/views/catalog/products.php
... | ... | @@ -5,7 +5,8 @@ |
5 | 5 | |
6 | 6 | use common\modules\product\models\Product; |
7 | 7 | use yii\helpers\ArrayHelper; |
8 | - use yii\helpers\Url; | |
8 | + use yii\helpers\Html; | |
9 | + use yii\helpers\Url; | |
9 | 10 | use yii\widgets\Breadcrumbs; |
10 | 11 | use yii\web\View; |
11 | 12 | use common\modules\product\helpers\ProductHelper; |
... | ... | @@ -28,8 +29,8 @@ |
28 | 29 | //foreach($category->getParents()->all() as $parent) { |
29 | 30 | // $this->params['breadcrumbs'][] = ['label' => $parent->categoryName->value, 'url' => ['catalog/category', 'category' => $parent]]; |
30 | 31 | //} |
31 | - $this->params['breadcrumbs'][] = ['label' => 'Каталог', 'url' => Url::to(['catalog/category']),'itemprop' => 'url', ]; | |
32 | - $this->params['breadcrumbs'][] = $category->categoryName->value; | |
32 | + $this->params['breadcrumbs'][] = ['label' => '<span itemprop="title">Каталог</span>', 'url' => Url::to(['catalog/category']),'itemprop' => 'url' ]; | |
33 | + $this->params['breadcrumbs'][] = Html::tag('span', $category->categoryName->value, ['itemprop' => 'title']); | |
33 | 34 | |
34 | 35 | |
35 | 36 | $this->registerCssFile (Yii::getAlias('@web/css/ion.rangeSlider.css')); | ... | ... |
frontend/views/layouts/main.php
... | ... | @@ -247,9 +247,10 @@ $this->registerJs(" |
247 | 247 | <span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> |
248 | 248 | <nav class="bread-crumbs"> |
249 | 249 | <?= Breadcrumbs::widget ([ |
250 | - 'homeLink' => ['label' => 'Главная', 'url' => Url::to(['/']),'itemprop' => 'url', ], | |
251 | - 'itemTemplate' => "<li><span itemprop=\"title\">{link}</span></li>\n", // template for all links | |
250 | + 'homeLink' => ['label' => '<span itemprop="title">Главная</span>', 'url' => Url::to(['/']),'itemprop' => 'url', ], | |
251 | + 'itemTemplate' => "<li>{link}</li>\n", // template for all links | |
252 | 252 | 'links' => $this->params['breadcrumbs'], |
253 | + 'encodeLabels' => false, | |
253 | 254 | ]) |
254 | 255 | ?> |
255 | 256 | ... | ... |