Answer the question
In order to leave comments, you need to log in
How to set up a catalog template so that section pages are filled with meta tags from the fields of the SEO tab?
The site is powered by Bitrix.
For site pages with sections with a list of elements (products) and for the elements (products) themselves, meta tags are filled in correctly from the fields of the SEO tab.
On the site, for pages of top-level sections (with a list of subsections) of the catalog component, meta tags are filled out not from the fields of the SEO tab. For such sections, meta tags are taken from the section titles. How to fix this issue.
Probably, something is written incorrectly in the bitrix:catalog.section.list section list template?
If we replace the catalog component template with another one instead of the default one, then the meta tags of such sections will be filled in from the fields of the SEO tab. However, I can’t use another template, because the output of sections, elements and their formatting on the page is violated.
Below is the bitrix template code:catalog.section.list
++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++ ++
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?><?if (!empty($arResult["SECTION_USER_FIELDS"]["UF_BROWSER_TITLE"]))
$APPLICATION ->SetTitle($arResult["SECTION"]["SECTION_USER_FIELDS"]["UF_BROWSER_TITLE"]);
else
$APPLICATION->SetTitle($arResult["SECTION"]["NAME"]);
if (!empty($arResult["SECTION_USER_FIELDS"]["UF_TITLE_H1"]))
$APPLICATION->SetPageProperty("ADDITIONAL_TITLE", $arResult["SECTION"]["SECTION_USER_FIELDS"]["UF_TITLE_H1"]);
$APPLICATION->SetPageProperty("title", $arResult["SECTION"]["NAME"]);
$APPLICATION->SetPageProperty("description", $arResult["SECTION"]["NAME"]);
$APPLICATION->SetPageProperty("keywords", $arResult["SECTION"]["NAME"]);
$TOP_DEPTH = $arResult["SECTION"]["DEPTH_LEVEL"];
$CURRENT_DEPTH = $TOP_DEPTH;
?>
<? if (!empty($arResult["SECTIONS"])): ?>
<? if (($arSection["ELEMENT_CNT"] > 0) || !empty($arSection["DESCRIPTION"])): ?> " href="<?=$arSection["SECTION_PAGE_URL"]?>"><? en... <?endif;?> |
Answer the question
In order to leave comments, you need to log in
Parameters of the bitrix:catalog component
If you comment out part of the code, an error occurs
/* <?if (!empty($arResult["SECTION_USER_FIELDS"]["UF_BROWSER_TITLE"]))
$APPLICATION->SetTitle($arResult["SECTION"]["SECTION_USER_FIELDS "]["UF_BROWSER_TITLE"]);
else
$APPLICATION->SetTitle($arResult["SECTION"]["NAME"]);
if (!empty($arResult["SECTION_USER_FIELDS"]["UF_TITLE_H1"]))
$APPLICATION->SetPageProperty("ADDITIONAL_TITLE", $arResult["SECTION"]["SECTION_USER_FIELDS"]["UF_TITLE_H1"]);
else
$APPLICATION->SetPageProperty("ADDITIONAL_TITLE", $arResult["SECTION"]["NAME"]);?>
<?
$APPLICATION->SetPageProperty("title", $arResult["SECTION"]["NAME"]);
$APPLICATION->SetPageProperty("description", $arResult["SECTION"]["NAME"]);
$APPLICATION->SetPageProperty("keywords", $arResult["SECTION"]["NAME"]);
*/
So you have meta tags set in the template code -
<?
$APPLICATION->SetTitle($arResult["SECTION"]["SECTION_USER_FIELDS"]["UF_BROWSER_TITLE"]);
else
$APPLICATION->SetTitle($arResult["SECTION"]["NAME"]);
if (!empty($arResult["SECTION_USER_FIELDS"]["UF_TITLE_H1"]))
$APPLICATION->SetPageProperty("ADDITIONAL_TITLE", $arResult["SECTION"]["SECTION_USER_FIELDS"]["UF_TITLE_H1"]);
else
$APPLICATION->SetPageProperty("ADDITIONAL_TITLE", $arResult["SECTION"]["NAME"]);?>
<?
$APPLICATION->SetPageProperty("title", $arResult["SECTION"]["NAME"]);
$APPLICATION->SetPageProperty("description", $arResult["SECTION"]["NAME"]);
$APPLICATION->SetPageProperty("keywords", $arResult["SECTION"]["NAME"]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question