Maks | fix: вывел Сео текст из редактора раздела

web_99
Andrei 2 months ago
parent d59b612557
commit 63c9afabff
  1. 68
      local/templates/.default/components/bitrix/catalog/main/section_vertical.php

@ -1,6 +1,16 @@
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
die();
/**
* @global CMain $APPLICATION
* @var CBitrixComponent $component
* @var array $arParams
* @var array $arResult
* @var array $arCurSection
*/
use Bitrix\Main\Loader;
use Bitrix\Main\ModuleManager;
use Bitrix\Iblock\SectionTable;
@ -44,29 +54,18 @@ if (!empty($sotbitSeoMetaBreadcrumbTitle)) {
$GLOBALS['CATALOG_CURRENT_SECTION_ID'] = $intSectionID;
// Получаем ID раздела из arResult
$sectionId = $arResult['VARIABLES']['SECTION_ID'] ?? null;
if ($sectionId) {
if ($arCurSection["ID"]) {
$res = CIBlockSection::GetList([], [
'ID' => $sectionId,
'ID' => $arCurSection["ID"],
'ACTIVE' => 'Y',
'GLOBAL_ACTIVE' => 'Y'
], false, ['ID', 'NAME', 'SECTION_PAGE_URL']);
], false, ['ID', 'NAME', 'SECTION_PAGE_URL', 'DESCRIPTION']);
if ($arSection = $res->GetNext()) {
$APPLICATION->AddChainItem($arSection['NAME'], $arSection['SECTION_PAGE_URL']);
}
}
/**
* @global CMain $APPLICATION
* @var CBitrixComponent $component
* @var array $arParams
* @var array $arResult
* @var array $arCurSection
*/
if (isset($arParams['USE_COMMON_SETTINGS_BASKET_POPUP']) && $arParams['USE_COMMON_SETTINGS_BASKET_POPUP'] == 'Y') {
$basketAction = $arParams['COMMON_ADD_TO_BASKET_ACTION'] ?? '';
} else {
@ -336,17 +335,30 @@ $APPLICATION->IncludeComponent(
</section>
<? // GP | SEO-текст ?>
<section class="catalog-page__seo container section">
<?if ($sotbitSeoMetaBottomDesc):?>
<? echo $sotbitSeoMetaBottomDesc; //вывод нижнего описания ?>
<?else:?>
<? $APPLICATION->IncludeComponent(
"bitrix:main.include",
"",
array(
"AREA_FILE_SHOW" => "file",
"PATH" => "/include/catalog-seo-text.php"
)
); ?>
<?endif;?>
<style>
.catalog-page__one__seo-item {
background-color: #f5f5f5;
border-radius: 24px;
padding: 28px;
}
</style>
<section class="catalog-page__seo__one container section">
<div class="catalog-page__one__seo-item">
<?
if($sotbitSeoMetaBottomDesc){
echo $sotbitSeoMetaBottomDesc; //вывод нижнего описания
}elseif($arSection['DESCRIPTION']){
echo $arSection['DESCRIPTION'];
}else{
$APPLICATION->IncludeComponent(
"bitrix:main.include",
"",
array(
"AREA_FILE_SHOW" => "file",
"PATH" => "/include/catalog-seo-text.php"
)
);
}
?>
</div>
</section>
Loading…
Cancel
Save