185 lines
10 KiB
PHP
185 lines
10 KiB
PHP
<?php
|
|
use Bitrix\Main\DI\ServiceLocator;
|
|
use Bitrix\Main\Localization\Loc;
|
|
use Bitrix\Main\Page\Asset;
|
|
|
|
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php");
|
|
Loc::loadMessages(__FILE__);
|
|
$APPLICATION->SetPageProperty("description", Loc::getMessage("VINO_HOME_DESCRIPTION"));
|
|
$APPLICATION->SetPageProperty("og_image", VINO_HOST . SITE_TEMPLATE_PATH . "/assets/media/og-home.jpg");
|
|
$APPLICATION->SetTitle(Loc::getMessage("VINO_HOME_TITLE"));
|
|
$tpl = SITE_TEMPLATE_PATH;
|
|
Asset::getInstance()->addJs(SITE_TEMPLATE_PATH . "/assets/js/vino-slider.js");
|
|
$wineCount = ServiceLocator::getInstance()->get("jinove.vinoteca.wineStats")->getActiveCount();
|
|
?>
|
|
<h1 class="vino-sr-only"><?= Loc::getMessage("VINO_HOME_H1") ?></h1>
|
|
<?php $APPLICATION->IncludeComponent("bitrix:news.list", "vhero", array(
|
|
"IBLOCK_TYPE" => "content",
|
|
"IBLOCK_ID" => VINO_BANNERS_IBLOCK,
|
|
"NEWS_COUNT" => "4",
|
|
"SORT_BY1" => "SORT",
|
|
"SORT_ORDER1" => "ASC",
|
|
"SORT_BY2" => "ID",
|
|
"SORT_ORDER2" => "ASC",
|
|
"FIELD_CODE" => array("PREVIEW_PICTURE", "PREVIEW_TEXT"),
|
|
"PROPERTY_CODE" => array("KICKER", "LINK", "LINK_TEXT"),
|
|
"CHECK_DATES" => "Y",
|
|
"SET_TITLE" => "N",
|
|
"SET_BROWSER_TITLE" => "N",
|
|
"SET_META_KEYWORDS" => "N",
|
|
"SET_META_DESCRIPTION" => "N",
|
|
"SET_LAST_MODIFIED" => "N",
|
|
"SET_STATUS_404" => "N",
|
|
"SHOW_404" => "N",
|
|
"INCLUDE_IBLOCK_INTO_CHAIN" => "N",
|
|
"ADD_SECTIONS_CHAIN" => "N",
|
|
"DISPLAY_TOP_PAGER" => "N",
|
|
"DISPLAY_BOTTOM_PAGER" => "N",
|
|
"CACHE_TYPE" => "A",
|
|
"CACHE_TIME" => "36000000",
|
|
"CACHE_GROUPS" => "N",
|
|
), false); ?>
|
|
|
|
<?php $APPLICATION->IncludeComponent("bitrix:news.list", "vinoteca-brands", array(
|
|
"IBLOCK_TYPE" => "catalog",
|
|
"IBLOCK_ID" => VINO_BRANDS_IBLOCK,
|
|
"NEWS_COUNT" => "8",
|
|
"DETAIL_URL" => SITE_DIR . "brands/#ELEMENT_CODE#/",
|
|
"SORT_BY1" => "SORT",
|
|
"SORT_ORDER1" => "ASC",
|
|
"SORT_BY2" => "NAME",
|
|
"SORT_ORDER2" => "ASC",
|
|
"FIELD_CODE" => array("PREVIEW_PICTURE"),
|
|
"PROPERTY_CODE" => array("COUNTRY", "REGION"),
|
|
"CHECK_DATES" => "Y",
|
|
"SET_TITLE" => "N",
|
|
"SET_BROWSER_TITLE" => "N",
|
|
"SET_META_KEYWORDS" => "N",
|
|
"SET_META_DESCRIPTION" => "N",
|
|
"SET_LAST_MODIFIED" => "N",
|
|
"SET_STATUS_404" => "N",
|
|
"SHOW_404" => "N",
|
|
"INCLUDE_IBLOCK_INTO_CHAIN" => "N",
|
|
"ADD_SECTIONS_CHAIN" => "N",
|
|
"DISPLAY_TOP_PAGER" => "N",
|
|
"DISPLAY_BOTTOM_PAGER" => "N",
|
|
"CACHE_TYPE" => "A",
|
|
"CACHE_TIME" => "36000000",
|
|
"CACHE_GROUPS" => "N",
|
|
), false); ?>
|
|
|
|
<section class="vino-section vino-bestsellers">
|
|
<div class="vino-wrap vino-section__inner">
|
|
<div class="vino-section__head">
|
|
<div class="vino-section__intro">
|
|
<p class="vino-kicker"><?= Loc::getMessage("VINO_HOME_BEST_KICKER") ?></p>
|
|
<h2 class="vino-section__title"><?= Loc::getMessage("VINO_HOME_BEST_TITLE") ?></h2>
|
|
</div>
|
|
<div class="vino-slider__nav">
|
|
<button type="button" class="vino-arrow" data-slide-prev aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_HOME_PREV")) ?>"><svg class="vino-arrow__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 5 8 12l7 7"></path></svg></button>
|
|
<button type="button" class="vino-arrow" data-slide-next aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_HOME_NEXT")) ?>"><svg class="vino-arrow__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 5 7 7-7 7"></path></svg></button>
|
|
</div>
|
|
</div>
|
|
<div class="vino-section__body">
|
|
<div class="vino-slider__viewport" data-slider="bestsellers">
|
|
<div class="vino-slider__track">
|
|
<?php $APPLICATION->IncludeComponent("bitrix:catalog.top", "vinoteca-row", \Jinove\Vinoteca\Catalog\Listing::prepareBestsellers(), false); ?>
|
|
</div>
|
|
</div>
|
|
<div class="vino-progress" data-slider-progress="bestsellers"><span class="vino-progress__bar"></span></div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="vino-section vino-new-arrivals">
|
|
<div class="vino-wrap vino-section__inner">
|
|
<div class="vino-section__head">
|
|
<div class="vino-section__intro">
|
|
<p class="vino-kicker"><?= Loc::getMessage("VINO_HOME_NEW_KICKER") ?></p>
|
|
<h2 class="vino-section__title"><?= Loc::getMessage("VINO_HOME_NEW_TITLE") ?></h2>
|
|
</div>
|
|
<div class="vino-slider__head-actions vino-section__all">
|
|
<a class="vino-section__more" href="<?= SITE_DIR ?>catalog/"><?= Loc::getMessage("VINO_HOME_ALL_COLLECTION") ?> <span class="vino-section__count"><?= Loc::getMessagePlural("VINO_HOME_COUNT", $wineCount, array("#COUNT#" => $wineCount)) ?></span></a>
|
|
<div class="vino-slider__nav">
|
|
<button type="button" class="vino-arrow" data-arrivals-prev aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_HOME_PREV")) ?>"><svg class="vino-arrow__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 5 8 12l7 7"></path></svg></button>
|
|
<button type="button" class="vino-arrow" data-arrivals-next aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_HOME_NEXT")) ?>"><svg class="vino-arrow__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 5 7 7-7 7"></path></svg></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="vino-section__body">
|
|
<div class="vino-slider__viewport" data-slider="arrivals"><div class="vino-slider__track">
|
|
<?php $APPLICATION->IncludeComponent("bitrix:catalog.top", "vinoteca-row", array(
|
|
"IBLOCK_TYPE" => "catalog",
|
|
"IBLOCK_ID" => VINO_CATALOG_IBLOCK,
|
|
"ELEMENT_COUNT" => "8",
|
|
"ELEMENT_SORT_FIELD" => "PROPERTY_VINTAGE",
|
|
"ELEMENT_SORT_ORDER" => "desc",
|
|
"ELEMENT_SORT_FIELD2" => "ID",
|
|
"ELEMENT_SORT_ORDER2" => "desc",
|
|
"PROPERTY_CODE" => array("WINE_COLOR", "SUGAR", "VOLUME", "REGION", "COUNTRY"),
|
|
"PRICE_CODE" => array("BASE"),
|
|
"PRICE_VAT_INCLUDE" => "Y",
|
|
"USE_PRICE_COUNT" => "N",
|
|
"SHOW_PRICE_COUNT" => "1",
|
|
"CONVERT_CURRENCY" => "N",
|
|
"HIDE_NOT_AVAILABLE" => "N",
|
|
"DETAIL_URL" => SITE_DIR . "catalog/#SECTION_CODE#/#ELEMENT_CODE#/",
|
|
"SECTION_URL" => SITE_DIR . "catalog/#SECTION_CODE#/",
|
|
"CACHE_TYPE" => "A",
|
|
"CACHE_TIME" => "3600",
|
|
"CACHE_GROUPS" => "N",
|
|
"CACHE_FILTER" => "N",
|
|
), false); ?>
|
|
</div></div>
|
|
<div class="vino-progress" data-slider-progress="arrivals"><span class="vino-progress__bar"></span></div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="vino-story">
|
|
<div class="vino-wrap">
|
|
<div class="vino-story__grid">
|
|
<div class="vino-story__image">
|
|
<picture class="vino-story__picture">
|
|
<source type="image/webp" srcset="<?= $tpl ?>/assets/media/story-vineyard-480.webp 480w, <?= $tpl ?>/assets/media/story-vineyard-800.webp 800w, <?= $tpl ?>/assets/media/story-vineyard.webp?v=7 1080w" sizes="(min-width: 768px) 50vw, 100vw">
|
|
<img class="vino-story__img" loading="lazy" decoding="async" width="800" height="1200" src="<?= $tpl ?>/assets/media/story-vineyard-800.jpg" alt="<?= htmlspecialcharsbx(Loc::getMessage("VINO_HOME_STORY_ALT")) ?>">
|
|
</picture>
|
|
</div>
|
|
<div class="vino-story__body">
|
|
<?php $APPLICATION->IncludeComponent("bitrix:main.include", "", array("AREA_FILE_SHOW" => "file", "PATH" => SITE_DIR . "include/home-story.php"), false); ?>
|
|
<a class="vino-btn vino-btn--outline" href="<?= SITE_DIR ?>about/"><?= Loc::getMessage("VINO_HOME_ABOUT") ?> <svg class="vino-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="vino-section vino-news">
|
|
<div class="vino-wrap vino-section__inner">
|
|
<div class="vino-section__head">
|
|
<div class="vino-section__intro">
|
|
<p class="vino-kicker"><?= Loc::getMessage("VINO_HOME_NEWS_KICKER") ?></p>
|
|
<h2 class="vino-section__title"><?= Loc::getMessage("VINO_HOME_NEWS_TITLE") ?></h2>
|
|
</div>
|
|
<a class="vino-section__all vino-section__link" href="<?= \Jinove\Vinoteca\News::folder() ?>"><?= Loc::getMessage("VINO_HOME_NEWS_ALL") ?> <svg class="vino-section__link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg></a>
|
|
</div>
|
|
<div class="vino-section__body">
|
|
<?php $APPLICATION->IncludeComponent("bitrix:news.list", "vinoteca-news", \Jinove\Vinoteca\News::homeParams(), false); ?>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<script type="application/ld+json"><?= json_encode(array(
|
|
"@context" => "https://schema.org",
|
|
"@type" => "WebPage",
|
|
"@id" => VINO_HOST . SITE_DIR . "#webpage",
|
|
"url" => VINO_HOST . SITE_DIR,
|
|
"name" => Loc::getMessage("VINO_HOME_H1"),
|
|
"description" => $APPLICATION->GetPageProperty("description"),
|
|
"inLanguage" => LANGUAGE_ID,
|
|
"about" => array("@id" => VINO_HOST . "/#store"),
|
|
"mainEntity" => array("@id" => VINO_HOST . "/#store"),
|
|
"primaryImageOfPage" => \Jinove\Vinoteca\PageSchema::image(VINO_HOST . SITE_DIR . "#image", VINO_HOST . SITE_TEMPLATE_PATH . "/assets/media/og-home.jpg", 1200, 630),
|
|
"workTranslation" => \Jinove\Vinoteca\PageSchema::translations(SITE_DIR, "WebPage"),
|
|
), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP) ?></script>
|
|
<?php
|
|
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php");
|