Commit 74873101b2cdc8a9a33b830e2e887c56ed1b86a3

Authored by Yarik
1 parent 3f44ed5a

Breadcrumbs fix?

frontend/views/catalog/products.php
@@ -5,7 +5,8 @@ @@ -5,7 +5,8 @@
5 5
6 use common\modules\product\models\Product; 6 use common\modules\product\models\Product;
7 use yii\helpers\ArrayHelper; 7 use yii\helpers\ArrayHelper;
8 - use yii\helpers\Url; 8 + use yii\helpers\Html;
  9 + use yii\helpers\Url;
9 use yii\widgets\Breadcrumbs; 10 use yii\widgets\Breadcrumbs;
10 use yii\web\View; 11 use yii\web\View;
11 use common\modules\product\helpers\ProductHelper; 12 use common\modules\product\helpers\ProductHelper;
@@ -28,8 +29,8 @@ @@ -28,8 +29,8 @@
28 //foreach($category->getParents()->all() as $parent) { 29 //foreach($category->getParents()->all() as $parent) {
29 // $this->params['breadcrumbs'][] = ['label' => $parent->categoryName->value, 'url' => ['catalog/category', 'category' => $parent]]; 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 $this->registerCssFile (Yii::getAlias('@web/css/ion.rangeSlider.css')); 36 $this->registerCssFile (Yii::getAlias('@web/css/ion.rangeSlider.css'));
frontend/views/layouts/main.php
@@ -247,9 +247,10 @@ $this-&gt;registerJs(&quot; @@ -247,9 +247,10 @@ $this-&gt;registerJs(&quot;
247 <span itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> 247 <span itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
248 <nav class="bread-crumbs"> 248 <nav class="bread-crumbs">
249 <?= Breadcrumbs::widget ([ 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 'links' => $this->params['breadcrumbs'], 252 'links' => $this->params['breadcrumbs'],
  253 + 'encodeLabels' => false,
253 ]) 254 ])
254 ?> 255 ?>
255 256