templates/document.html.twig line 1

Open in your IDE?
  1. {# get root node if there is no document defined (for pages which are routed directly through static route) #}
  2. {% if not document is defined or not document %}
  3.     {% set document = pimcore_document(1) %}
  4. {% endif %}
  5. {# get the document which should be used to start in navigation | default home #}
  6. {% if locale == 'de' %}
  7.     {% set navStartNode = pimcore_document( constant('SITE_ROOT_ID_DE') ) %}
  8. {% elseif locale == 'en' %}
  9.     {% set navStartNode = pimcore_document( constant('SITE_ROOT_ID_EN') ) %}
  10. {% else %}
  11.     {% set navStartNode = document.getProperty('navigationRoot') %}
  12. {% endif %}
  13. {# Pimcore default -> deactivated
  14. {% if not navStartNode is instanceof('\\Pimcore\\Model\\Document\\Page') %}
  15.     {% set navStartNode = pimcore_document(1) %}
  16. {% endif %}
  17. #}
  18. {% set mainNavigation = pimcore_build_nav({
  19.     active: document,
  20.     root: navStartNode
  21. }) %}
  22. {% if document is defined and document.type == 'page' %}
  23.       {% do pimcore_head_meta().setDescription(document.getDescription) %}
  24. {% endif %}
  25. {% do pimcore_head_meta().setProperty('og:locale', locale) %}
  26. {% do pimcore_head_meta().setProperty('og:url', app.request.uri ) %}
  27. {% do pimcore_head_meta().setProperty('og:site_name', constant('SITE_NAME') ) %}
  28. {% if newsarticle is defined %}
  29.     {% if newsarticle is instanceof('\\Pimcore\Model\DataObject\Newsblog') %}
  30.         {% do pimcore_head_meta().setProperty('og:type', 'article') %}
  31.         {% do pimcore_head_meta().setProperty('og:title', newsarticle.headline ) %}
  32.         {% do pimcore_head_meta().setProperty('og:description', newsarticle.teaser | raw ) %}
  33.         {% do pimcore_head_meta().setProperty('article:modified_time', date( timestamp ).format('c') ) %}
  34.     {% endif %}
  35. {% endif %}
  36. {% set user = app.user %}
  37. <!DOCTYPE html>
  38. <html lang="{{ locale }}"> 
  39.   <head>
  40.     <meta charset="utf-8">
  41.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  42.     <meta name="viewport" content="width=device-width, initial-scale=1">    
  43.     <title>{% if document.type == 'page' and document.getTitle() is not empty %}{{ document.getTitle() }}{% endif %}</title>   
  44.     {{ pimcore_head_meta() }}
  45.     <link rel="canonical" href="{{ app.request.uri }}" />
  46.     <meta name="author" content="{{ constant('SITE_NAME') }}">
  47.     <meta name="generator" content="78media solutions">    
  48.     <link rel="icon" href="{{ constant('SITE_TEMPLATE_PATH') }}/img/favicons/favicon-192x192.png" sizes="192x192" type="image/png">
  49.     <link rel="apple-touch-icon" href="{{ constant('SITE_TEMPLATE_PATH') }}/img/favicons/apple-touch-icon.png" sizes="180x180">
  50.     <link rel="icon" href="{{ constant('SITE_TEMPLATE_PATH') }}/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
  51.     <link rel="icon" href="{{ constant('SITE_TEMPLATE_PATH') }}/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
  52.     <link rel="manifest" href="{{ constant('SITE_TEMPLATE_PATH') }}/img/favicons/manifest.json">
  53.     <link rel="mask-icon" href="{{ constant('SITE_TEMPLATE_PATH') }}/img/favicons/safari-pinned-tab.svg" color="#563d7c">
  54.     <link rel="icon" href="{{ constant('SITE_TEMPLATE_PATH') }}/img/favicons/favicon.ico">    
  55.     <!-- base -->
  56.     <link href="{{ constant('SITE_TEMPLATE_PATH') }}/css/bootstrap.min.css" rel="stylesheet">
  57.     <link href="{{ constant('SITE_TEMPLATE_PATH') }}/css/animate.min.css" rel="stylesheet" />
  58.     <link href="{{ constant('SITE_TEMPLATE_PATH') }}/css/jquery.fancybox.min.css" rel="stylesheet">
  59.     <link href="{{ constant('SITE_TEMPLATE_PATH') }}/plugins/slick/slick.css" rel="stylesheet">
  60.     <link href="{{ constant('SITE_TEMPLATE_PATH') }}/plugins/slick/slick-theme.css" rel="stylesheet">
  61.     <!-- theme -->
  62.     <link href="{{ constant('SITE_TEMPLATE_PATH') }}/css/screen.less?v={{ 'now'|date('U') }}" rel="stylesheet/less" type="text/css">   
  63.     <script src="{{ constant('SITE_TEMPLATE_PATH') }}/js/less.min.js" language="javascript"></script> 
  64.     {% if editmode %}
  65.     <link href="{{ constant('SITE_TEMPLATE_PATH') }}/css/editmode.css?v={{ 'now'|date('U') }}" rel="stylesheet">
  66.     {% endif %}
  67.     
  68.     <!-- Google tag (gtag.js) -->
  69.     <script async src="https://www.googletagmanager.com/gtag/js?id=AW-927743781">
  70.     </script>
  71.     <script>
  72.       window.dataLayer = window.dataLayer || [];
  73.       function gtag(){dataLayer.push(arguments);}
  74.       gtag('js', new Date());
  75.       gtag('config', 'AW-927743781');
  76.     </script>
  77.   </head>
  78.   <body id="body">
  79.     
  80.     <header>
  81.       <!-- div wrapper needed !!! -->
  82.       <div class="header-options">       
  83.         <a class="navbar-toggler d-block" data-toggle="navbar-header">
  84.           <div id="nav-icon">
  85.             <span></span>
  86.             <span></span>
  87.             <span></span>
  88.             <span></span>
  89.           </div>
  90.         </a>        
  91.         <a class="language-switch" data-toggle="language-selection" href="/{{ (locale=='en' ? 'de' : 'en') }}/">
  92.           <img class="language {{ (locale=='en') ? 'active-en' : 'active-de' }}" src="{{ constant('SITE_TEMPLATE_PATH') }}/img/flags/de-en.png" />
  93.         </a>   
  94.       </div>
  95.       <!-- end div wrapper !!! -->
  96.       <div class="header-logo">
  97.         <a href="/{{ locale }}">
  98.           <img src="{{ constant('SITE_TEMPLATE_PATH') }}/img/logo_7schwaben.png" alt="7SCHWABEN" title="7SCHWABEN Ferienwohnungen Apartments in Bad Urach" />
  99.         </a>
  100.       </div>      
  101.     </header>
  102.     
  103.     {# \Pimcore\Navigation\Renderer\Menu #}
  104.     {% set menuRenderer = pimcore_nav_renderer('menu') %}
  105.     {{ menuRenderer.renderPartial( mainNavigation, '_includes/7schwaben_navigation.html.twig' ) | raw }}
  106.     
  107.     <main style="padding-top:3rem;">
  108.       <!-- document block content -->  
  109.       {{ block('main_content') }}
  110.       <div id="footer-switch" style="height:1px; background:transparent;">
  111.       </div>
  112.   
  113.       {{ include('_includes/contactForm.html.twig') }}
  114.     </main>
  115.     {{ include('_includes/footer.html.twig') }}
  116.   </body>
  117. </html>