Commit 3f9327023ea865adde7b90c17d67c3a5329d9d94

Authored by Timur Kastemirov
1 parent abff3f71

blog seo and remove author from blog/view

common/messages/ru/app.php
... ... @@ -125,4 +125,7 @@ return [
125 125 'Go to contact page' => 'На страницу контактов',
126 126 'Share' => 'Поделиться',
127 127 'All' => "Все",
  128 + 'Blog Search' => "Поиск в Блоге",
  129 + "Blog Category" => "Категория Блога",
  130 + "Blog Tag" => "Тэг Блога",
128 131 ];
129 132 \ No newline at end of file
... ...
frontend/views/blog/index.php
... ... @@ -15,10 +15,34 @@
15 15 use frontend\widgets\SearchWidget;
16 16 use frontend\widgets\CategoryWidget;
17 17 use frontend\widgets\TagWidget;
  18 + use yii\helpers\Url;
18 19  
19 20 $settings = Settings::getInstance();
20 21  
21   - $this->params['h1'] = \Yii::t('app', 'menu-blog');
  22 + switch (Yii::$app->controller->action->id){
  23 +
  24 + case "search":
  25 + $this->params['h1'] = \Yii::t('app', 'Blog Search');
  26 + break;
  27 + case "category":
  28 + $this->params['h1'] = \Yii::t('app', 'Blog Category');
  29 + break;
  30 + case "tag":
  31 + $this->params['h1'] = \Yii::t('app', 'Blog Tag');
  32 + break;
  33 + default:
  34 + $this->params['h1'] = \Yii::t('app', 'menu-blog');
  35 + break;
  36 +
  37 + }
  38 +
  39 + if ( Yii::$app->controller->action->id !== Yii::$app->controller->defaultAction ){
  40 + $this->params[ 'breadcrumbs' ][] = [
  41 + 'label' => Yii::t('app', "menu-blog"),
  42 + 'url' => Url::toRoute(['blog/index'])
  43 + ];
  44 + }
  45 +
22 46 $this->params[ 'breadcrumbs' ][] = $this->params['h1'];
23 47  
24 48 ?>
... ...
frontend/views/layouts/main.php
... ... @@ -624,7 +624,8 @@
624 624 <?php
625 625 if (
626 626 Yii::$app->controller->id === $default_controller ||
627   - Yii::$app->controller->action->id === $controller->defaultAction
  627 + Yii::$app->controller->action->id === $controller->defaultAction ||
  628 + Yii::$app->controller->action->id === 'search'
628 629 ){
629 630 echo (isset($this->params['h1']) && !empty($this->params['h1'])) ?
630 631 $this->params['h1'] :
... ...