From e7c5af40eac5a29fcd1c21cdec97ac545cf7ca28 Mon Sep 17 00:00:00 2001 From: timur Date: Mon, 27 Nov 2017 11:21:30 +0200 Subject: [PATCH] breadcrumbs --- frontend/assets/AppAsset.php | 2 -- frontend/controllers/SiteController.php | 2 -- frontend/views/layouts/main.php | 3 ++- frontend/views/site/comments.php | 4 +++- frontend/web/.gitignore | 1 + frontend/widgets/SeoBreadcrumbs.php | 6 ++++-- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php index 2c4e5b1..a23d0ca 100755 --- a/frontend/assets/AppAsset.php +++ b/frontend/assets/AppAsset.php @@ -12,11 +12,9 @@ public $basePath = '@webroot'; public $baseUrl = '@web'; public $css = [ - 'css/site.css', 'css/animate.css', 'css/jquery-ui.min.css', 'css/jquery-ui.theme.min.css', - 'css/style.css', 'css/style.turquoise.css', 'css/owl.carousel.css', 'css/owl.theme.css', diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 8ba8c45..07c0b08 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -217,8 +217,6 @@ ] ); - $this->view->params[ 'breadcrumbs' ][] = \Yii::t('app', 'Комментарии'); - return $this->render( 'comments', [ diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index 28e1e98..aa6ada7 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -667,7 +667,8 @@ _________________________________________________________ --> 'label' => "".\Yii::t('app', 'Главная')."", 'url' => '/', 'itemprop' => 'item', - ] + ], + 'activeItemUrl' => \Yii::$app->request->getAbsoluteUrl(), ] ) ?> diff --git a/frontend/views/site/comments.php b/frontend/views/site/comments.php index c3fdc4a..0533401 100755 --- a/frontend/views/site/comments.php +++ b/frontend/views/site/comments.php @@ -8,7 +8,9 @@ * @var View $this * @var CommentModel $model */ - + + $this->params[ 'breadcrumbs' ][] = \Yii::t('app', 'Комментарии'); + ?>
diff --git a/frontend/web/.gitignore b/frontend/web/.gitignore index 434e07b..38a6e60 100755 --- a/frontend/web/.gitignore +++ b/frontend/web/.gitignore @@ -1,3 +1,4 @@ /index.php /index-test.php /sitemap.xml +/robots.txt diff --git a/frontend/widgets/SeoBreadcrumbs.php b/frontend/widgets/SeoBreadcrumbs.php index 107a65e..56ac3d4 100644 --- a/frontend/widgets/SeoBreadcrumbs.php +++ b/frontend/widgets/SeoBreadcrumbs.php @@ -30,6 +30,8 @@ 'itemprop' => 'item', ]; + public $activeItemUrl; + public $activeItemTemplate = '
  • {link}
  • '; public function run() @@ -70,11 +72,11 @@ $options = $link; unset($options['template'], $options['label'], $options['url']); if (!$home){ - $label = "".$label.""; + $label = "activeItemUrl}\">".$label.""; } $link = Html::a($label, $link['url'], $options); } else { - $link = $label; + $link = "activeItemUrl}\">".$label; } return strtr($template, ['{link}' => $link, '{number}' => $number]); } -- libgit2 0.21.4