user->identity; $seo = Yii::$app->get('seo'); $feedback = new Feedback(); $settings = Settings::getInstance(); $controller = Yii::$app->controller; $default_controller = Yii::$app->defaultRoute; $isHome = ( ( $controller->id === $default_controller ) && ( $controller->action->id === $controller->defaultAction ) ) ? true : false; $services = Service::find() ->where( [ 'status' => true, 'level' => 0, ] ) ->with( [ 'language.alias', 'services' => function (ActiveQuery $query) { $query->where([ 'status' => true ]) ->with( [ 'language.alias', 'services' => function (ActiveQuery $query) { $query->where([ 'status' => true ]) ->with([ 'language.alias' ]); }, ] ); }, ] ) ->orderBy('sort') ->all(); # для автоматической генерации SEO параметров (title/description) в ситуациях, когда этих параметров нету # мне нужно будет автоматически их подгенеривать, поэтому вместо $seo->title, которые является readOnly я использую эту переменную $seoTitleName = $seo->title; if ($seo->title == '' && \Yii::$app->controller->id == 'site' && \Yii::$app->controller->action->id == 'comments') { $currentServiceId = ( !empty(\Yii::$app->request->get('service_id')) ) ? \Yii::$app->request->get( 'service_id' ) : 0; $serviceModel = new Service([ 'id' => $currentServiceId ]); if ($currentServiceId !== 0) { $serviceName = $serviceModel->language->title; $seoTitleName = $this->params[ 'breadcrumbs' ][ 0 ] . ' - ' . $serviceName . ' - ' . \Yii::t( 'app', 'ABC short reverse' ); } else { $seoTitleName = $this->params[ 'breadcrumbs' ][ 0 ] . ' - ' . \Yii::t( 'app', 'General callbacks' ) . ' - ' . \Yii::t('app', 'ABC short reverse'); } } //----------------------------------------------------------------------------------------------------------------------- // Блок с микроразметкой для FB # $property нужно для property="og:type" FB switch (\Yii::$app->controller->id) { case "site": $property = 'website'; break; case "blog": $property = 'article'; break; case 'service': $property = 'product'; break; default: $property = 'website'; break; } $this->registerMetaTag( [ 'property' => 'og:description', 'content' => $seo->desc, ] ); $this->registerMetaTag( [ 'property' => "og:type", 'content' => $property, ] ); $this->registerMetaTag( [ 'property' => "og:url", 'content' => Url::current(), ] ); $this->registerMetaTag( [ 'property' => "og:title", 'content' => $seo->title, ] ); $this->registerMetaTag( [ 'name' => 'description', 'content' => ( \Yii::$app->controller->id == 'site' && \Yii::$app->controller->action->id == 'comments' && $seo->desc == null ) ? $seoTitleName : $seo->desc, ] ); //---------------------------------------------------------------------------------------------------------------------- $this->registerMetaTag( [ 'name' => 'robots', // 'content' => $seo->robots, 'content' => 'noindex,nofollow', ] ); $module = \Yii::$app->getModule('feedback'); $aliases = Alias::find() ->where([ 'route' => '{"0":"site/questions"}' ]) ->indexBy('route') ->andWhere([ 'language_id' => Language::getCurrent()->id ]) ->asArray() ->all(); $commentUrl = Alias::find() ->where([ 'route' => '{"0":"site/comments","service_id":0}' ]) ->indexBy('route') ->andWhere([ 'language_id' => Language::getCurrent()->id ]) ->asArray() ->all(); ?> beginPage() ?> <?= Html::encode($seoTitleName); ?> head() ?> beginBody() ?>
params[ 'breadcrumbs' ])) { ?>
address; ?>
phone) or !empty($settings->phone2)) { $phones = array_merge(explode(';', $settings->phone2), [ $settings->phone ]); ?>

email)) { ?>
phone) or !empty($settings->phone2)) { $phones = array_merge(explode(';', $settings->phone2), [ $settings->phone ]); ?> getModule('feedback'); // ArtboxModalWidget::begin([ // 'modalTagOptions' => [ // 'id' => 'callback' // ], // 'titleTagOptions' => [ // 'class' => 'style form-title' // ], // 'headerText' => \Yii::t('app', 'Callback'), // 'closeTagButton' => 'span', // 'closeTagContent' => '', // 'closeButtonOptions' => [ // 'id' => 'modal_close' // ] // ]); // // $module->renderForm($this); // // ArtboxModalWidget::end(); // ?> getModule('visit'); if (isset($this->params[ 'entity' ]) and isset($this->params[ 'entity_id' ])) { $moduleVisit->inputOptions = array_merge( $moduleVisit->inputOptions, [ 'entity' => [ 'type' => 'hiddenInput', 'options' => [ 'value' => $this->params[ 'entity' ] ], ], 'entity_id' => [ 'type' => 'hiddenInput', 'options' => [ 'value' => $this->params[ 'entity_id' ] ], ], ] ); } ArtboxModalWidget::begin( [ 'modalTagOptions' => [ 'id' => 'write-to', ], 'titleTagOptions' => [ 'class' => 'style form-title', ], 'headerText' => \Yii::t('app', 'Make an appointment'), 'closeTagButton' => 'span', 'closeTagContent' => '', 'closeButtonOptions' => [ 'id' => 'modal_close', ], ] ); $moduleVisit->renderForm($this); ArtboxModalWidget::end(); ?> * { * "@context": "http://schema.org", * "@type": "Organization", * "url": "http://www.your-company-site.com", * "logo": "http://www.example.com/logo.png", * "contactPoint": [{ * "@type": "ContactPoint", * "telephone": "+1-401-555-1212", * "contactType": "customer service" * }] * } * */ $layoutMicrodata = [ 'context' => 'http://schema.org/', 'type' => 'Organization', 'url' => Url::home(true), #'logo'=>'http://www.example.com/logo.png', 'logo' => Url::home(true) . "storage/logo/" . $settings->logo, 'contactPoint' => [ '@type' => 'ContactPoint', 'contactType' => "customer service", ], ]; if (isset($phones[ 0 ])) { $layoutMicrodata[ 'contactPoint' ][ 'telephone' ] = "+38" . $phones[ 0 ]; } $settings->email; $microdata = new MicrodataFabric(); $pageMicrodata = $microdata::createJsonFromOrganization($layoutMicrodata) ->toJson(); echo $pageMicrodata ?> endBody() ?> endPage() ?>