{# Set page title #}
{# If document title is empty use document name #}
{% if document.getTitle() is not empty %}
{% set pageTitle = document.getTitle() %}
{% else %}
{% set pageTitle = document.getProperty('navigation_name') %}
{% endif %}
{% set parentPageId = document.getParentId() %}
{% if pimcore_document(parentPageId) %}
{% set grandparentPageId = pimcore_document(parentPageId).getParentId() %}
{% endif %}
{# Append parent page to document title #}
{% set pageParentTitle = '' %}
{% if pimcore_document(parentPageId) and pimcore_document(parentPageId).getType != 'folder' and pimcore_document(grandparentPageId) and pimcore_document(grandparentPageId).getRealPath != '/' %}
{% set pageParentTitle = ' - ' ~ pimcore_document(parentPageId).getProperty('navigation_name') %}
{% endif %}
{# {{dump(document)}} #}
{# Append page root title to document title #}
{% set pageSiteTitle = '' %}
{% if document.getProperty('navStartDocument') %}
{% set pageSiteTitle = ' - ' ~ get_document_title(document.getProperty('navStartDocument').getParent()) %}
{% endif %}
{# {% set pageDocumentTitle = get_document_title(document.getProperty('navStartDocument').getParent()) %} #}
{# Combine all titles together #}
{% set pageTitleComplete = pageTitle ~ pageParentTitle ~ pageSiteTitle %}
{% do pimcore_head_title().append(pageTitleComplete) %}
{# End set page title #}
{# Set meta description #}
{% if document is instanceof('\\Pimcore\\Model\\Document\\Page') %}
{% if document.getDescription is not empty %}
{% do pimcore_head_meta().setDescription(document.getDescription()) %}
{% endif %}
{% endif %}
{# End set meta description #}
{# Start pimcore_head_meta variables #}
{% do pimcore_head_meta().setProperty('robots', 'index,follow') %}
{# Facebook open-graph #}
{% do pimcore_head_meta().setProperty('og:url', app.request.getUri()) %}
{% do pimcore_head_meta().setProperty('og:type', 'website') %}
{% do pimcore_head_meta().setProperty('og:title', pageTitleComplete) %}
{% do pimcore_head_meta().setProperty('og:site_name', pageTitle) %}
{% if document is instanceof('\\Pimcore\\Model\\Document\\Page') %}
{% do pimcore_head_meta().setProperty('og:description', pageTitleComplete)%}
{% if document.getDescription() is not empty %}
{% do pimcore_head_meta().setProperty('og:description', document.getDescription())%}
{% endif %}
{% endif %}
{% do pimcore_head_meta().setProperty('og:image', absolute_url('/frontend/dist/favicons/apple-touch-icon-1024x1024.png')) %}
{# Twitter #}
{% do pimcore_head_meta().setProperty('twitter:card', 'summary') %}
{% do pimcore_head_meta().setProperty('twitter:url', app.request.getUri()) %}
{% if document is instanceof('\\Pimcore\\Model\\Document\\Page') %}
{% do pimcore_head_meta().setProperty('twitter:description', pageTitleComplete) %}
{% if document.getDescription() is not empty %}
{% do pimcore_head_meta().setProperty('twitter:description', document.getDescription()) %}
{% endif %}
{% endif %}
{% do pimcore_head_meta().setProperty('twitter:image', absolute_url('/frontend/dist/favicons/apple-touch-icon-1024x1024.png')) %}
{# End pimcore_head_meta variables #}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{# Main meta tags #}
{# we're using the deferred extension here to make sure this block is rendered after all helper calls #}
{% block layout_head_meta %}
{{ pimcore_head_title() }}
{{ pimcore_head_meta() }}
{% if pimcore_placeholder('canonical').count() %}
<link rel="canonical" href="{{ pimcore_placeholder('canonical') }}"/>
{% endif %}
{% endblock %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="copyright" content="{{ 'ercas_doc_fe_meta_copyright_ercas' | trans }}">
<meta name="date" content="{{ document.getModificationDate() | date("Y-m-d") }}" scheme="YYYY-MM-DD">
{# WebApps #}
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title">
<meta name="application-name">
<meta name="mobile-web-app-capable" content="yes">
<meta name="msapplication-TileColor" content="#fff">
<meta name="msapplication-TileImage" content="/frontend/dist/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="/frontend/dist/favicons/browserconfig.xml">
<meta name="theme-color" content="#fff">