templates/base.html.twig line 1

  1. <!DOCTYPE html>
  2. {% if '/_sulu_preview' in app.request.requesturi %}
  3.     {% set class = 'preview' %}
  4. {% else %}
  5.     {% set class = 'no-preview' %}
  6. {% endif %}
  7. <html lang="{{ app.request.locale|split('_')[0] }}" class="{{ class }}">
  8. <head>
  9.     <meta charset="utf-8">
  10.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11.     <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  12.     <link rel="apple-touch-icon" sizes="180x180" href="{{ asset('/img/apple-touch-icon.png') }}">
  13.     <link rel="icon" type="image/png" sizes="32x32" href="{{ asset('/img/favicon-32x32.png') }}">
  14.     <link rel="icon" type="image/png" sizes="16x16" href="{{ asset('/img/favicon-16x16.png') }}">
  15.     <script id="usercentrics-cmp" src="https://app.usercentrics.eu/browser-ui/latest/loader.js"
  16.             data-version="preview" data-settings-id="rUzp4CflN" async></script>
  17.     <link rel="preconnect" href="//app.usercentrics.eu">
  18.     <link rel="preconnect" href="//api.usercentrics.eu">
  19.     <link rel="preload" href="//app.usercentrics.eu/browser-ui/latest/loader.js" as="script">
  20.     {#    <link rel="manifest" href="/site.webmanifest"> #}
  21.     {# OG Image Default #}
  22.     {% set socialMedia = sulu_snippet_load_by_area('social_media') %}
  23.     {% if socialMedia is not empty and socialMedia['content'] is not empty %}
  24.         {% set defaultOG = socialMedia['content'] %}
  25.         {% if defaultOG['ogImageUrlGlobal'] is not empty %}
  26.             {% set ogImage = defaultOG['ogImageUrlGlobal'] %}
  27.             {% set basePath = app.request.schemeAndHttpHost %}
  28.             {% set ogImagePath = basePath ~ ogImage.thumbnails['320x'] %}
  29.         {% endif %}
  30.     {% endif %}
  31.     {# OG Image for specific page #}
  32.     {% if extension is not empty and extension['opengraph'] is not empty %}
  33.         {% set opengraph = extension['opengraph'] %}
  34.         {% if opengraph['ogImageTitle'] is not empty %}
  35.             <meta property="og:title" content="{{ opengraph['ogImageTitle'] }}"/>
  36.         {% endif %}
  37.         {% if opengraph['ogImageDescription'] is not empty %}
  38.             <meta property="og:description" content="{{ opengraph['ogImageDescription'] }}"/>
  39.         {% endif %}
  40.         {% if opengraph['ogImageUrl'] is not empty and opengraph['ogImageUrl']['id'] is not empty %}
  41.             {# Image must be loaded separately #}
  42.             {% set ogImageMedia = sulu_resolve_media(opengraph['ogImageUrl']['id'], app.request.locale|split('_')[0]) %}
  43.             {% if ogImageMedia is not empty %}
  44.                 {% set basePath = app.request.schemeAndHttpHost %}
  45.                 {% set ogImagePath = basePath ~ ogImageMedia.thumbnails['320x'] %}
  46.             {% endif %}
  47.         {% endif %}
  48.         {% if opengraph['ogVideoUrl'] is not empty and opengraph['ogVideoUrl']['id'] is not empty %}
  49.             {# Video must be loaded separately #}
  50.             {% set ogVideoMedia = sulu_resolve_media(opengraph['ogVideoUrl']['id'], app.request.locale|split('_')[0]) %}
  51.             {% if ogImageMedia is not empty %}
  52.                 {% set basePath = app.request.schemeAndHttpHost %}
  53.                 {% set ogVideoPath = basePath ~ ogVideoMedia.url %}
  54.             {% endif %}
  55.         {% endif %}
  56.     {% endif %}
  57.     {# OG Video available --> use OG Video #}
  58.     {# Otherwise if OG Image available --> use OG Image #}
  59.     {% if ogVideoPath is defined and ogVideoPath is not empty %}
  60.         <meta property="og:type" content="video.other">
  61.         <meta property="og:video" content="{{ ogVideoPath|replace({'?v=1': ''}) }}"/>
  62.         <meta property="og:video:url" content="{{ ogVideoPath|replace({'?v=1': ''}) }}"/>
  63.         <meta property="og:video:secure_url" content="{{ ogVideoPath|replace({'?v=1': ''}) }}"/>
  64.         <meta property="og:video:type" content="application/mp4"/>
  65.     {% elseif ogImagePath is defined and ogImagePath is not empty %}
  66.         <meta property="og:image" content="{{ ogImagePath|replace({'?v=1-0': ''}) }}"/>
  67.     {% endif %}
  68.     <meta name="msapplication-TileColor" content="#da532c">
  69.     <meta name="theme-color" content="#ffffff">
  70.     {% block meta %}
  71.         {% include "@SuluWebsite/Extension/seo.html.twig" with {
  72.             "seo": extension.seo|default([]),
  73.             "content": content|default([]),
  74.             "localizations": localizations|default([]),
  75.             "shadowBaseLocale": shadowBaseLocale|default(),
  76.         } %}
  77.     {% endblock %}
  78.     {% block metaSeo %}
  79.         {# ... #}
  80.     {% endblock metaSeo %}
  81.     {% block style %}
  82.     {% endblock %}
  83. </head>
  84. <body>
  85. {% if class != "preview" %}
  86.     <script defer src="{{ asset('assets/index.js') }}"></script>
  87. {% endif %}
  88. {% if class == "preview" %}
  89.     <script defer src="{{ asset('assets/modal-preview.js') }}"></script>
  90.     <script> window.disableRevealAnimations = true; </script>
  91. {% endif %}
  92. <div class="page-wrapper" x-data="page" x-cloak>
  93.     <div class="page">
  94.         {#            {{ include('/includes/header-nav.html.twig') }} #}
  95.         {% block header %}
  96.         {% endblock %}
  97.         {# <form action="{{ path('sulu_search.website_search') }}" method="GET"> #}
  98.         {# <input name="q" type="text" placeholder="Search"/> #}
  99.         {# <input type="submit" value="Go"/> #}
  100.         {# </form> #}
  101.         <main>
  102.             {% block content %}{% endblock %}
  103.         </main>
  104.         {% block footer %}
  105.         {% endblock %}
  106.     </div>
  107. </div>
  108. {% block javascripts %}{% endblock %}
  109. </body>
  110. </html>