2022-11-24 08:39:31 +03:00

60 lines
2.1 KiB
PHP

<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/** @var array $arParams */
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var CBitrixComponent $component */
$this->setFrameMode(true);
$markup_content = [
"@context" => "https://schema.org",
"@type" => "NewsArticle",
"headline" => $arResult['NAME'],
"image" => [
"https://".SITE_SERVER_NAME.$arResult['DETAIL_PICTURE'],
],
"datePublished" => FormatDate(DATE_W3C, MakeTimeStamp($arResult['ACTIVE_FROM'])),
"dateModified" => FormatDate(DATE_W3C, MakeTimeStamp($arResult['ACTIVE_FROM'])),
"author" => [
[
"@type" => "Organization",
"name" => "Эволюция Автолизинга",
"url" => "https://".SITE_SERVER_NAME."/",
],
],
];
$APPLICATION->AddHeadString('<script type="application/ld+json">'.json_encode($markup_content).'</script>', false, "AFTER_JS");
?>
<section data-page>
<div class="container">
<p class="section_title">Новость</p>
<div class="news_container">
<div class="image">
<img src="<?= $arResult['DETAIL_PICTURE']; ?>" alt="<?= $arResult['NAME']; ?>" />
</div>
<h1><?= $arResult['NAME']; ?></h1>
<date class="date"><?= FormatDate("d F Y", MakeTimeStamp($arResult['ACTIVE_FROM'])); ?></date>
<?= $arResult['DETAIL_TEXT']; ?>
<? $APPLICATION->IncludeComponent("bitrix:main.share", "evolution", Array(
"HIDE" => "N", // Скрыть панель закладок по умолчанию
"HANDLERS" => array( // Используемые соц. закладки и сети
"facebook",
"vk",
),
"PAGE_URL" => "https://".$_SERVER['SERVER_NAME'].$arResult["DETAIL_PAGE_URL"], // URL страницы относительно корня сайта
"PAGE_TITLE" => $arResult["NAME"], // Заголовок страницы
),
false
); ?>
</div>
</div>
</section>