Commit e7c5af40eac5a29fcd1c21cdec97ac545cf7ca28

Authored by Timur Kastemirov
1 parent 363f1aab

breadcrumbs

frontend/assets/AppAsset.php
... ... @@ -12,11 +12,9 @@
12 12 public $basePath = '@webroot';
13 13 public $baseUrl = '@web';
14 14 public $css = [
15   - 'css/site.css',
16 15 'css/animate.css',
17 16 'css/jquery-ui.min.css',
18 17 'css/jquery-ui.theme.min.css',
19   - 'css/style.css',
20 18 'css/style.turquoise.css',
21 19 'css/owl.carousel.css',
22 20 'css/owl.theme.css',
... ...
frontend/controllers/SiteController.php
... ... @@ -217,8 +217,6 @@
217 217 ]
218 218 );
219 219  
220   - $this->view->params[ 'breadcrumbs' ][] = \Yii::t('app', 'Комментарии');
221   -
222 220 return $this->render(
223 221 'comments',
224 222 [
... ...
frontend/views/layouts/main.php
... ... @@ -667,7 +667,8 @@ _________________________________________________________ -->
667 667 'label' => "<span itemprop='name'>".\Yii::t('app', 'Главная')."</span>",
668 668 'url' => '/',
669 669 'itemprop' => 'item',
670   - ]
  670 + ],
  671 + 'activeItemUrl' => \Yii::$app->request->getAbsoluteUrl(),
671 672 ]
672 673 ) ?>
673 674  
... ...
frontend/views/site/comments.php
... ... @@ -8,7 +8,9 @@
8 8 * @var View $this
9 9 * @var CommentModel $model
10 10 */
11   -
  11 +
  12 + $this->params[ 'breadcrumbs' ][] = \Yii::t('app', 'Комментарии');
  13 +
12 14 ?>
13 15 <div id="content" class="feedback-wr">
14 16 <div class="container">
... ...
frontend/web/.gitignore
1 1 /index.php
2 2 /index-test.php
3 3 /sitemap.xml
  4 +/robots.txt
... ...
frontend/widgets/SeoBreadcrumbs.php
... ... @@ -30,6 +30,8 @@
30 30 'itemprop' => 'item',
31 31 ];
32 32  
  33 + public $activeItemUrl;
  34 +
33 35 public $activeItemTemplate = '<li class="active" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><span itemprop="name">{link}<meta itemprop="position" content="{number}" /></span></li>';
34 36  
35 37 public function run()
... ... @@ -70,11 +72,11 @@
70 72 $options = $link;
71 73 unset($options['template'], $options['label'], $options['url']);
72 74 if (!$home){
73   - $label = "<span itemprop='name'>".$label."</span>";
  75 + $label = "<link itemprop=\"item\" href=\"{$this->activeItemUrl}\"><span itemprop='name'>".$label."</span>";
74 76 }
75 77 $link = Html::a($label, $link['url'], $options);
76 78 } else {
77   - $link = $label;
  79 + $link = "<link itemprop=\"item\" href=\"{$this->activeItemUrl}\">".$label;
78 80 }
79 81 return strtr($template, ['{link}' => $link, '{number}' => $number]);
80 82 }
... ...