Commit e7c5af40eac5a29fcd1c21cdec97ac545cf7ca28

Authored by Timur Kastemirov
1 parent 363f1aab

breadcrumbs

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