40 lines
1.5 KiB
PHP
40 lines
1.5 KiB
PHP
<?php
|
|
use Bitrix\Main\Localization\Loc;
|
|
|
|
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
|
|
die();
|
|
}
|
|
|
|
$requested = \Bitrix\Main\Context::getCurrent()->getRequest()->getQuery("PAGEN_1");
|
|
$page = 1;
|
|
if ($requested !== null) {
|
|
if ($requested === "1") {
|
|
LocalRedirect(VINO_HOST . \Jinove\Vinoteca\News::folder(), true, "301 Moved Permanently");
|
|
}
|
|
if (!is_string($requested) || !ctype_digit($requested) || (int)$requested < 2 || (int)$requested > \Jinove\Vinoteca\News::pageCount()) {
|
|
\Bitrix\Iblock\Component\Tools::process404("", true, true, true);
|
|
|
|
return;
|
|
}
|
|
$page = (int)$requested;
|
|
}
|
|
$meta = \Jinove\Vinoteca\News::pageMeta($page);
|
|
$APPLICATION->SetTitle(Loc::getMessage("VINO_NEWS_HEADING"));
|
|
$APPLICATION->SetPageProperty("title", $meta["title"]);
|
|
$APPLICATION->SetPageProperty("description", $meta["description"]);
|
|
if ($page > 1) {
|
|
$APPLICATION->SetPageProperty("vino_canonical", $meta["canonical"]);
|
|
}
|
|
?>
|
|
<section class="vino-razdel-hero">
|
|
<div class="vino-wrap">
|
|
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array(Loc::getMessage("VINO_NEWS_H1")))); ?>
|
|
<h1 class="vino-razdel-hero__title"><?= Loc::getMessage("VINO_NEWS_HEADING") ?></h1>
|
|
</div>
|
|
</section>
|
|
<section class="vino-news-feed">
|
|
<div class="vino-wrap">
|
|
<?php $APPLICATION->IncludeComponent("bitrix:news.list", \Jinove\Vinoteca\News::LIST_TEMPLATE, \Jinove\Vinoteca\News::listParams(), $component); ?>
|
|
</div>
|
|
</section>
|