Maks | отформатировал /catalog/main/section_vertical.php

web_99
Andrei 2 months ago
parent 446a6d36a5
commit cd78504835
  1. 92
      local/templates/.default/components/bitrix/catalog/main/section_vertical.php

@ -1,4 +1,5 @@
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die(); <? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
die();
use Bitrix\Main\Loader; use Bitrix\Main\Loader;
use Bitrix\Main\ModuleManager; use Bitrix\Main\ModuleManager;
@ -8,6 +9,31 @@ use Bitrix\Iblock\SectionTable;
Loader::includeModule('iblock'); Loader::includeModule('iblock');
// Устанавливаем SEO мета-теги
global $sotbitSeoMetaTitle;
global $sotbitSeoMetaKeywords;
global $sotbitSeoMetaDescription;
global $sotbitSeoMetaBreadcrumbTitle;
global $sotbitSeoMetaH1;
if (!empty($sotbitSeoMetaH1)) {
$APPLICATION->SetTitle($sotbitSeoMetaH1);
}
if (!empty($sotbitSeoMetaTitle)) {
$APPLICATION->SetPageProperty("title", $sotbitSeoMetaTitle);
}
if (!empty($sotbitSeoMetaKeywords)) {
$APPLICATION->SetPageProperty("keywords", $sotbitSeoMetaKeywords);
}
if (!empty($sotbitSeoMetaDescription)) {
$APPLICATION->SetPageProperty("description", $sotbitSeoMetaDescription);
}
if (!empty($sotbitSeoMetaBreadcrumbTitle)) {
$APPLICATION->AddChainItem($sotbitSeoMetaBreadcrumbTitle);
}
$GLOBALS['CATALOG_CURRENT_SECTION_ID'] = $intSectionID;
// Получаем ID раздела из arResult // Получаем ID раздела из arResult
$sectionId = $arResult['VARIABLES']['SECTION_ID'] ?? null; $sectionId = $arResult['VARIABLES']['SECTION_ID'] ?? null;
@ -31,24 +57,25 @@ if ($sectionId) {
* @var array $arCurSection * @var array $arCurSection
*/ */
if (isset($arParams['USE_COMMON_SETTINGS_BASKET_POPUP']) && $arParams['USE_COMMON_SETTINGS_BASKET_POPUP'] == 'Y') if (isset($arParams['USE_COMMON_SETTINGS_BASKET_POPUP']) && $arParams['USE_COMMON_SETTINGS_BASKET_POPUP'] == 'Y') {
{
$basketAction = $arParams['COMMON_ADD_TO_BASKET_ACTION'] ?? ''; $basketAction = $arParams['COMMON_ADD_TO_BASKET_ACTION'] ?? '';
} } else {
else
{
$basketAction = $arParams['SECTION_ADD_TO_BASKET_ACTION'] ?? ''; $basketAction = $arParams['SECTION_ADD_TO_BASKET_ACTION'] ?? '';
} }
?>
<?
$APPLICATION->IncludeComponent(
$APPLICATION->IncludeComponent("bitrix:breadcrumb","breadcrumbs",Array( "bitrix:breadcrumb",
"breadcrumbs",
array(
"START_FROM" => "0", "START_FROM" => "0",
"PATH" => "", "PATH" => "",
"SITE_ID" => "s1" "SITE_ID" => "s1"
) )
); );
?> ?>
<? // GP | Главный экран ?>
<section class="text-section section container"> <section class="text-section section container">
<div class="text-section__title"> <div class="text-section__title">
Компания <span class="orange-text">Эра</span><span class="green-text">Септик</span> более 10 лет оказывает услуги по производству и установке септиков для загородных домов и дач Компания <span class="orange-text">Эра</span><span class="green-text">Септик</span> более 10 лет оказывает услуги по производству и установке септиков для загородных домов и дач
@ -58,6 +85,7 @@ $APPLICATION->IncludeComponent("bitrix:breadcrumb","breadcrumbs",Array(
</p> </p>
</section> </section>
<? // GP | Сайдбар с фильтром ?>
<section class="catalog-page container section"> <section class="catalog-page container section">
<h2 class="catalog-page__title">Каталог товаров</h2> <h2 class="catalog-page__title">Каталог товаров</h2>
<div class="catalog-page__wrap"> <div class="catalog-page__wrap">
@ -238,8 +266,11 @@ $intSectionID = $APPLICATION->IncludeComponent(
?> ?>
</div> </div>
</section> </section>
<?php
// Подключаем компонент sotbit:seo.meta
<? // GP | Подключаем компонент sotbit:seo.meta ?>
<?
$APPLICATION->IncludeComponent( $APPLICATION->IncludeComponent(
"sotbit:seo.meta", "sotbit:seo.meta",
".default", ".default",
@ -250,37 +281,11 @@ $APPLICATION->IncludeComponent(
"CACHE_TIME" => $arParams["CACHE_TIME"], "CACHE_TIME" => $arParams["CACHE_TIME"],
) )
); );
?>
// Устанавливаем SEO мета-теги
global $sotbitSeoMetaTitle;
global $sotbitSeoMetaKeywords;
global $sotbitSeoMetaDescription;
global $sotbitSeoMetaBreadcrumbTitle;
global $sotbitSeoMetaH1;
if(!empty($sotbitSeoMetaH1))
{
$APPLICATION->SetTitle($sotbitSeoMetaH1);
}
if(!empty($sotbitSeoMetaTitle))
{
$APPLICATION->SetPageProperty("title", $sotbitSeoMetaTitle);
}
if(!empty($sotbitSeoMetaKeywords))
{
$APPLICATION->SetPageProperty("keywords", $sotbitSeoMetaKeywords);
}
if(!empty($sotbitSeoMetaDescription))
{
$APPLICATION->SetPageProperty("description", $sotbitSeoMetaDescription);
}
if(!empty($sotbitSeoMetaBreadcrumbTitle))
{
$APPLICATION->AddChainItem($sotbitSeoMetaBreadcrumbTitle);
}
$GLOBALS['CATALOG_CURRENT_SECTION_ID'] = $intSectionID; <? // GP | Популярные категории ?>
?>
<section class="catalog-page__services services container section"> <section class="catalog-page__services services container section">
<h2 class="section-title">Популярные категории</h2> <h2 class="section-title">Популярные категории</h2>
<div class="services__list"> <div class="services__list">
@ -311,7 +316,7 @@ $GLOBALS['CATALOG_CURRENT_SECTION_ID'] = $intSectionID;
</div> </div>
</section> </section>
<? // GP | SEO-текст ?>
<?php <?php
if (\Bitrix\Main\Loader::includeModule("iblock")) { if (\Bitrix\Main\Loader::includeModule("iblock")) {
$sectionId = $arResult['VARIABLES']['SECTION_ID']; $sectionId = $arResult['VARIABLES']['SECTION_ID'];
@ -327,9 +332,7 @@ if (\Bitrix\Main\Loader::includeModule("iblock")) {
echo '</div>'; echo '</div>';
} }
} }
} } else {
else{
?> ?>
<section class="catalog-page__seo container section"> <section class="catalog-page__seo container section">
@ -365,6 +368,3 @@ if (\Bitrix\Main\Loader::includeModule("iblock")) {
} }
} }
?> ?>

Loading…
Cancel
Save