{#
/**
* @var \Pimcore\Templating\PhpEngine view
* @var \Pimcore\Templating\GlobalVariables app
* #
* @var infrastructure Infrastructure
* @var detailEvents \Elements\Bundle\DemiFrontendBundle\Service\EventSearchFrontend
*/ #}
{% set infraType = 'infrastructure' %}
{% set url = linkGenerator().generate(infrastructure) %}
{% do elements_canonical().checkAllParams(false).setDomain(url) %}
{% if not url is same as(app.request.pathInfo) or infrastructure.getProperty('seo_noindex') == true %}
{% do elements_robots().setNoIndex(true) %}
{% endif %}
{#{% do elements_hreflang(['de', 'en']) %}#}
{% set metaTitle = infrastructure.getName() %}
{% set town = not infrastructure.getTowns() is empty ? infrastructure.getTowns()[0] : null %}
{% if town %}
{% set metaTitle = metaTitle ~ " " ~ 'demi.seo.in' | trans ~ " " ~ town.getName() %}
{% endif %}
{% if infrastructure.getMetaTitle() != '' %}
{% set metaTitle = infrastructure.getMetaTitle() %}
{% endif %}
{% set metaDesc = infrastructure.getShortDescription() %}
{% if metaDesc is empty %}
{% set metaDesc = infrastructure.getLongDescription() %}
{% endif %}
{% if infrastructure.getMetaDescription() != '' %}
{% set metaDesc = infrastructure.getMetaDescription() %}
{% endif %}
{% if metaDesc is empty %}
{% set metaDesc = demi_fillTranslation({"[OBJECT]" : infrastructure.getName(),
"[TOWN]" : town.getName(), "[REGION]" : town ? town.getRegion().getName() : ""}, "demi.infrastructure.detail.seo.fallbackdescription") %}
{% endif %}
{# {% do pimcore_placeholder('object_seotitle').set(metaTitle) %}#}
{# {% do pimcore_placeholder('object_seodescription').set(metaDesc) %}#}
{% do elements_head_title().setTitle(metaTitle, true) %}
{% do elements_head_meta().setDescription(metaDesc, true) %}
{% do jsConfig().add('backButton', true) %}
{% do pimcore_placeholder('addBreadcrumb').set({
'parentId' : document.getId(),
'url' : url,
'label' : infrastructure.getName()
}) %}
{% set currDate = carbon().create() %}
{% do elements_opengraph().setUrl(url) %}
{% set detailSlides = infrastructure.getImageDocuments(null, currDate) %}
{% if infrastructure.getFirstImage() is not empty %}
{% do elements_opengraph().addImage(infrastructure.getFirstImage().getThumbnail('slider-main').getPath()) %}
{% endif %}
{% extends('@ElementsDemiFrontend/Layout/project-layout.html.twig') %}
{% block content %}
{% set headerShort = '' %}
{% set headerLong = '' %}
{% if infrastructure.getDescriptions() is not empty %}
{% set headerShort = infrastructure.getShortDescription(app.request.getLocale(), currDate) %}
{% endif %}
{% if headerShort is empty %}
{% set headerShort = infrastructure.getShortDescription(demi_core_configuration("getFallBackLanguage",{}), currDate) %}
{% endif %}
{% set headerLong = infrastructure.getLongDescription(app.request.getLocale(), currDate) %}
{% if headerLong is empty %}
{% set headerLong = infrastructure.getLongDescription(demi_core_configuration("getFallBackLanguage",{}), currDate) %}
{% endif %}
{% set descriptionTypes = [] %}
{% set localDescriptions= [] %}
{% set arrivalDocuments = [] %}
{% for description in infrastructure.getDescriptions(app.request.locale) | filter((description) => description.getDescriptionLanguage is same as app.request.locale()) %}
{% if description.getProperty("demi_descriptionType") is not empty and description.getDescriptionType() is same as constant("\\Elements\\Demi\\Deskline\\Constant\\DescriptionInterface::DESCRIPTION_FERATEL_LOCAL") %}
{% set localDescriptions = localDescriptions | merge([description]) %}
{% elseif description.getDescriptionType() is same as constant("\\Elements\\Demi\\Deskline\\Constant\\DescriptionInterface::DESCRIPTION_ADDITIONAL_SERVICE_ARRIVAL") %}
{% set arrivalDocuments = arrivalDocuments|merge([description]) %}
{% else %}
{% set descriptionTypes = descriptionTypes | merge([description.getDescriptionType()]) %}
{% endif %}
{% endfor %}
{% set descriptionTypes = descriptionTypes | filter((value) => value not in descriptionTypes and
value is not same as constant('\\Elements\\Demi\\Deskline\\Constant\\DescriptionInterface::DESCRIPTION_INFRASTRUCTURE_LONG') and
value is not same as constant('\\Elements\\Demi\\Deskline\\Constant\\DescriptionInterface::DESCRIPTION_INFRASTRUCTURE_CURRENT_INFORMATION') and
value is not same as constant('\\Elements\\Demi\\Deskline\\Constant\\DescriptionInterface::DESCRIPTION_INFRASTRUCTURE_OPENING_TIMES') and
value is not same as constant('\\Elements\\Demi\\Deskline\\Constant\\DescriptionInterface::DESCRIPTION_INFRASTRUCTURE_PRICE_INFO') and
value is not same as constant('\\Elements\\Demi\\Deskline\\Constant\\DescriptionInterface::DESCRIPTION_INFRASTRUCTURE_SHORT')) %}
{% set cat = null %}
{% if infrastructure.getTopics() | first is not same as false %}
{% set cat = (infrastructure.getTopics() | first).getParent() %}
{% endif %}
{% set currentRange = demi_infrastructureGetOpeningHoursPretty(infrastructure, 'getOpeningTimes') %}
{% set jsonLd = demi_infrastructureGetJsonLdData(infrastructure, {"prettyOpeningTimes" : currentRange, "currtime" : currDate, "locale" : app.request.getLocale(), "metadesc" : metaDesc}) %}
{% do jsonLd().add("infrastructure", jsonLd) %}
{# {{ include("@ElementsDemiFrontend/Includes/canonicalOverride.html.twig", {#}
{# "object" : infrastructure#}
{# }) }}#}
{{ include('@ElementsDemiFrontend/Includes/tags/detail-infrastructure.html.twig', {
'infrastructure' : infrastructure,
'category' : cat
}) }}
<div id="demi-infrastructure-content" class="demi-infrastructure-detail">
{% set coord = [] %}
{% if infrastructure.getPosition() is not empty %}
{% set coord = {
'lat' : infrastructure.getPosition().getLatitude(),
'lng' : infrastructure.getPosition().getLongitude()
} %}
{% endif %}
{% set openingTimes = infrastructure.getOpeningTimesDescription(app.request.getLocale(), currDate) %}
{% set allDescriptions = infrastructure.getPriceInfoDescription(app.request.getLocale(), currDate) %}
{% set address = infrastructure.getAddress() %}
{% set addressBlock = [] %}
{% if address %}
{% if address.getCompany() is not same as '' %}
{% set addressBlock = addressBlock|merge([address.getCompany()]) %}
{% endif %}
{% if address.getFirstname() is not same as '' %}
{% set addressBlock = addressBlock|merge([address.getFirstname() ~ ' ' ~ address.getLastname()]) %}
{% endif %}
{% if address.getAddressLine1() is not same as '' %}
{% set addressBlock = addressBlock|merge([address.getAddressLine1()]) %}
{% endif %}
{% if address.getAddressLine2() is not same as '' %}
{% set addressBlock = addressBlock|merge([address.getAddressLine2()]) %}
{% endif %}
{% if address.getZipcode() is not same as '' or address.getTown() %}
{% set addressBlock = addressBlock|merge([address.getZipcode() ~ ' ' ~ address.getTown()]) %}
{% endif %}
{% endif %}
{% set generalDocuments = [] %}
{% for doc in infrastructure.getDocuments() %}
{% if doc is not instanceof("\\Pimcore\\Model\\DataObject\\DemiDocumentImage") %}
{% set generalDocuments = generalDocuments|merge([doc]) %}
{% endif %}
{% endfor %}
{% if infrastructure.foodAndBeverageSeatsInside or infrastructure.foodAndBeverageSeatsOutside %}
{% set seatsTxt = '' %}
{% if infrastructure.foodAndBeverageSeatsInside %}
{% set seatsTxt = seatsTxt ~ '<br><strong>' ~ 'infrastructure.detail.seats-inside'|trans ~ '</strong>: ' ~ infrastructure.foodAndBeverageSeatsInside %}
{% endif %}
{% if infrastructure.foodAndBeverageSeatsOutside %}
{% set seatsTxt = seatsTxt ~ '<br><strong>' ~ 'infrastructure.detail.seats-outside'|trans ~ '</strong>: ' ~ infrastructure.foodAndBeverageSeatsOutside %}
{% endif %}
{% endif %}
{% set coord = addressBlock is not empty %}
{% set templateData = {
'headerImage' : infrastructure.getFirstImage(null, currDate),
'detailHeadline' : infrastructure.getName(),
'detailLead' : headerShort,
'detailDescription' : headerLong ~ seatsTxt|default(''),
'currentInformation' : infrastructure.getDescription(constant('\\Elements\\Demi\\Deskline\\Constant\\DescriptionInterface::DESCRIPTION_INFRASTRUCTURE_CURRENT_INFORMATION'), app.request.getLocale(), currDate),
'hasGlossar' : not document.getProperty('noGlossary'),
'detailSlides' : detailSlides,
'detailDocuments' : generalDocuments ,
'videos' : videos ?? null,
'icon' : 'icon-marker',
'detailOpeningTimes' : openingTimes,
'openingTimes' : currentRange,
'arrivalDocuments' : arrivalDocuments,
'detailAccordionId' : 0,
'detailPriceText' : allDescriptions,
'detailEvents' : detailEvents ?? null,
'detailContactHeadline' : 'demi.infrastructure.detail.contact' | trans,
'headerMapCoord' : coord,
'googlePlaceId' : infrastructure.getProperty('google_place_id'),
'detailContact' : (address is not empty and addressBlock | length > 0 ? {
'address' : addressBlock | join('<br>'),
'phone' : address.getPhone(),
'mobile' : address.getMobile(),
'mail' : address.getEmail(),
'url' : address.getUrl(),
} : []),
'linkheadline' : 'demi.infrastructure.detail.links.headline' | trans,
'linkliste' : infrastructure.getLinks(),
'backlinktext' : 'demi.infrastructure.back' | trans,
'detailExtension' : infrastructure.getDemiExtension(),
'detailDescriptionTypes' : descriptionTypes,
'detailLocalDescriptions' : localDescriptions,
'sortedHealthMeasures' : sortedHealthMeasures
} %}
{{ include('@ElementsDemiFrontend/Infrastructure/detail/detail-templates.html.twig', {
"templateData" : templateData
}) }}
{{ include('@ElementsDemiFrontend/Infrastructure/includes/slide-before-footer.html.twig') }}
</div>
{% endblock %}