Last active
April 5, 2021 11:31
-
-
Save if0rest/94336657712f8705057d53ec6e128115 to your computer and use it in GitHub Desktop.
Set the page's number for metatag in Bitrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
AddEventHandler('main', 'OnEpilog', array('CMainHandlers', 'OnEpilogHandler')); | |
class CMainHandlers | |
{ | |
public static function OnEpilogHandler() | |
{ | |
global $APPLICATION; | |
if (isset($_GET['PAGEN_1']) && intval($_GET['PAGEN_1']) > 0) | |
{ | |
$pageNum = $_GET['PAGEN_1']; | |
switch ($APPLICATION->GetCurDir()) { | |
case '/catalog/': | |
$APPLICATION->SetPageProperty('title', "Одежда для детей и подростков 0 до 14 лет | Каталог: Страница {$pageNum}"); | |
$APPLICATION->SetPageProperty('description', "В каталоге представлены модели для детей и подростков от 0 до 14 лет. Каталог: Страница {$pageNum}."); | |
break; | |
case '/catalog/bluzy_i_rubashki/': | |
case '/catalog/bryuki_i_polukombinezony/': | |
case '/catalog/yubki_i_shorty/': | |
$APPLICATION->SetPageProperty('title', $APPLICATION->GetTitle()." для девочек | Каталог: Страница {$pageNum}"); | |
$APPLICATION->SetPageProperty('description', "Интернет-магазин представляет лимитированную коллекцию одежды: ".ToLower($APPLICATION->GetTitle())." для девочек по доступным ценам! Доставка по всей России."); | |
break; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment