leasing program (taxi) update to SEO requirements

This commit is contained in:
merelendor 2024-08-01 05:38:10 +03:00
parent 19d6a11432
commit 18389e5d3c
6 changed files with 13 additions and 11 deletions

View File

@ -508,10 +508,7 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
$APPLICATION->SetPageProperty("keywords", strtr($arParams['KEYWORDS'], [ "%BRAND" => $arResult['TITLES']['BRAND'], ]));
}
if(!isset($arParams['PROGRAM']))
{
$APPLICATION->AddHeadString('<link rel="canonical" href="https://'.SITE_SERVER_NAME.'/catalog/'.implode("/", $canonical).(count($canonical) > 0 ? "/" : "").'"/>');
}
$APPLICATION->AddHeadString('<link rel="canonical" href="https://'.SITE_SERVER_NAME.'/programs/'.$_REQUEST['PROGRAM'].'/'.implode("/", $canonical).(count($canonical) > 0 ? "/" : "").'"/>');
}
}

View File

@ -164,6 +164,7 @@ $subtitle = " в лизинг для юридических лиц и ИП";
"SORTING" => true,
"PROGRAM" => $arParams['PROGRAM'],
"SCROLL" => $arResult['SCROLL'],
"ALLOW_SEF_LINKS" => false,
)
); ?>
</div>

View File

@ -12,7 +12,7 @@ var bodies_slugs = [];
var engine_fuels_slugs = [];
var used = false;
function formCatalogFilter(p, pr, props, u)
function formCatalogFilter(p, pr, props, u, asl = true)
{
// console.log("FILTER", "program", pr);
path = p;
@ -20,6 +20,7 @@ function formCatalogFilter(p, pr, props, u)
current_params = props;
program = pr;
used = u;
allow_sef_links = asl;
$(".filter_header .tabs .tab").on("click", function()
{
@ -1225,7 +1226,7 @@ function filter_texts_resize()
"filter_keys": "Количество ключей",
"filter_pts": "Бумажный ПТС",
};
}
}
else if(window.innerWidth >= 768 && window.innerWidth < 960)
{
return {
@ -1453,7 +1454,7 @@ function init_filter()
}
}
if(s_count === 1)
if(allow_sef_links && s_count === 1)
{
if(selected['BODY'] !== undefined && selected['BODY'] !== null)
{

View File

@ -129,7 +129,7 @@ HTML;
<script>
$(function()
{
formCatalogFilter("<?= $arParams['PATH']; ?>", "<?= $arParams['PROGRAM']; ?>", <?= CUtil::PhpToJSObject($arResult['SELECTED']); ?>, <?= $arParams['USED'] ? "true" : "false"; ?>);
formCatalogFilter("<?= $arParams['PATH']; ?>", "<?= $arParams['PROGRAM']; ?>", <?= CUtil::PhpToJSObject($arResult['SELECTED']); ?>, <?= $arParams['USED'] ? "true" : "false"; ?>, <?= $arParams['ALLOW_SEF_LINKS'] ? "true" : "false"; ?>);
<? if($arResult['SCROLL']): ?>
$('html, body').animate({
scrollTop: $("#catalog").offset().top - 100

View File

@ -59,14 +59,16 @@ if($this->StartResultCache(60*60*24, md5(var_export($_POST, true))))
if(empty($ar_res['NAME'])) { define('ERROR_404', 'Y'); }
else
{
$APPLICATION->AddChainItem($ar_res["NAME"], "/programs/lizing-taksi/");
$ipropValues = new \Bitrix\Iblock\InheritedProperty\ElementValues($ar_res['IBLOCK_ID'], $ar_res["ID"]);
$meta = $ipropValues->getValues();
$APPLICATION->AddChainItem($meta['ELEMENT_PAGE_TITLE'], "/programs/lizing-taksi/");
$APPLICATION->SetPageProperty("title", $arParams['TITLE']);
$APPLICATION->SetPageProperty("description", $arParams['DESCRIPTION']);
$APPLICATION->SetPageProperty("keywords", $arParams['KEYWORDS']);
$arResult['NAME'] = "Такси в лизинг";
$APPLICATION->AddHeadString('<link rel="canonical" href="'.$ar_res['CANONICAL_PAGE_URL'].'"/>');
$arResult['NAME'] = $meta['ELEMENT_META_TITLE'];
}
$this->IncludeComponentTemplate();

View File

@ -28,6 +28,7 @@ $this->setFrameMode(true);
"MODIFICATION" => $_REQUEST['MODIFICATION'],
"DRIVE" => $_REQUEST['DRIVE'],
"BODY" => $_REQUEST['BODY'],
"BODY_SLUG" => $_REQUEST['BODY_SLUG'],
"GEAR" => $_REQUEST['GEAR'],
"ENGINE_FUEL" => $_REQUEST['ENGINE_FUEL'],
"ENGINE_POWER_FROM" => $_REQUEST['ENGINE_POWER_FROM'],