templates/layouts/layout.html.twig line 1

Open in your IDE?
  1. <!doctype html>
  2. <html lang="{{ app.request.locale }}">
  3.     <head>
  4.         <!-- Required meta tags -->
  5.         <meta charset="utf-8">
  6.         <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7.         {% apply spaceless %}
  8.             {# add global stylesheets and scripts outside of any blocsk to add them to the helpers before any others assets are added #}
  9.             {# we use the view helper to have cache buster functionality #}
  10.             {% do pimcore_head_link().appendStylesheet('https://fonts.googleapis.com/css?family=Hind+Guntur:300,400,500,600,700&display=swap') %}
  11.             {% do pimcore_head_link().appendStylesheet('https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css',null,null,{integrity:"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T",crossorigin:"anonymous"}) %}
  12.             {% do pimcore_head_link().appendStylesheet('https://use.fontawesome.com/releases/v5.9.0/css/all.css') %}
  13.             {% do pimcore_head_link().appendStylesheet(asset('static/lib/magnific/magnific.css'), 'screen') %}
  14.             {% do pimcore_head_link().appendStylesheet(asset('static/lib/autocompletejs/css/autoComplete.css'), 'screen') %}
  15.             {% do pimcore_head_link().appendStylesheet('https://use.fontawesome.com/releases/v5.7.0/css/all.css',null,null,{integrity:'sha384-lZN37f5QGtY3VHgisS14W3ExzMWZxybE1SJSEsQp9S+oqd12jhcu+A56Ebc1zFSJ',crossorigin:'anonymous'}) %}
  16.             {% do pimcore_head_link().appendStylesheet(asset('static/css/global.css')) %}
  17.             {% if editmode %}
  18.                 {% do pimcore_head_link().appendStylesheet(asset('static/css/editmode.css')) %}
  19.             {% endif %}
  20.             {% do pimcore_head_script().appendFile('https://code.jquery.com/jquery-3.3.1.slim.min.js',null,null,{ integrity:"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo",crossorigin:"anonymous"}) %}
  21.             {% do pimcore_head_script().appendFile('https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js',null,null,{ integrity:"sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1",crossorigin:"anonymous"}) %}
  22.             {% do pimcore_head_script().appendFile('https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js',null,null,{ integrity:"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM",crossorigin:"anonymous"}) %}
  23.             {% do pimcore_head_script().appendFile(asset('static/lib/magnific/magnific.js')) %}
  24.             {% do pimcore_head_script().appendFile(asset('static/lib/autocompletejs/js/autoComplete.min.js')) %}
  25.             {% do pimcore_head_script().appendFile(asset('static/js/search-autocomplete.js')) %}
  26.             {% do pimcore_head_script().appendFile(asset('static/js/main.js')) %}
  27.             {% if not editmode %}
  28.                     {% do pimcore_head_script().appendFile(asset('static/js/frontend.js')) %}
  29.             {% endif %}
  30.             {% if not document is defined or not document %}
  31.                 {% set document = pimcore_document(1) %}
  32.             {% endif %}
  33.             {% if document is instanceof('\\Pimcore\\Model\\Document\\Link') %}
  34.                 {# @var document \Pimcore\Model\Document\Link #}
  35.                 {% set document = document.getObject() %}
  36.             {% endif %}
  37.             {% if document.getTitle() is not empty %}
  38.                 {% do pimcore_head_title().set(document.getTitle()) %}
  39.             {% endif %}
  40.             {% if document.getDescription() is not empty %}
  41.                 {% do pimcore_head_meta().setDescription(document.getDescription()) %}
  42.             {% endif %}
  43.             {% do pimcore_head_title().append('Pimcore Demo') %}
  44.             {% do pimcore_head_title().setSeparator(' : ') %}
  45.             {% set isPortal = ((isPortal is defined) and isPortal) %}
  46.         {% endapply %}
  47.         {# we're using the deferred extension here to make sure this block is rendered after all helper calls #}
  48.         {% block layout_head_meta deferred %}
  49.             {{ pimcore_head_title() }}
  50.             {{ pimcore_head_meta() }}
  51.             {% if pimcore_placeholder('canonical').count() %}
  52.                 <link rel="canonical" href="{{ pimcore_placeholder('canonical') }}"/>
  53.             {% endif %}
  54.         {% endblock %}
  55.         {% block head_stylesheets deferred %}
  56.             {{ pimcore_head_link() }}
  57.         {% endblock %}
  58.     </head>
  59.     <body>
  60.         {# get root node if there is no document defined (for pages which are routed directly through static route) #}
  61.         {% if not document is defined or not document %}
  62.             {% set document = pimcore_document(1) %}
  63.         {% endif %}
  64.         <nav class="navbar navbar-expand-md navbar-dark sticky-top py-1 site-header {{ document.getProperty('header_color') }}">
  65.             {# get the document which should be used to start in navigation | default home #}
  66.             {% set navStartNode = document.getProperty('navigation_root') %}
  67.             {% if not navStartNode is instanceof('\\Pimcore\\Model\\Document') %}
  68.                 {% set navStartNode = pimcore_document(1) %}
  69.             {% endif %}
  70.             {% set mainNavigation =  app_navigation_data_links(document, navStartNode) %}
  71.             <div class="container">
  72.                 {#Logo Image#}
  73.                 <a class="py-2 mb-2" href="{{ navStartNode }}">
  74.                     <img id="logo" src="{{ asset('/static/images/logo.svg') }}" alt="Classic Cars - Pimcore Demo">
  75.                 </a>
  76.                 {#responsive burger menu icon#}
  77.                 <button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
  78.                     <span class="navbar-toggler-icon"></span>
  79.                 </button>
  80.                 {#main header#}
  81.                 <div class="navbar-collapse collapse" id="navbarCollapse">
  82.                     {#header - generate pimcore navigation #}
  83.                     {{
  84.                         pimcore_render_nav(mainNavigation, 'menu', 'renderMenu', {
  85.                             maxDepth: 2,
  86.                             ulClass: {
  87.                                 0: 'navbar-nav menu-links ml-4 m-auto',
  88.                                 1: 'dropdown dropdown-menu',
  89.                                 'default': 'dropdown-menu dropdown-submenu'
  90.                             }
  91.                         })
  92.                     }}
  93.                     {#header - navigation icons#}
  94.                     {{ include('includes/navigation-icons.html.twig') }}
  95.                 </div>
  96.             </div>
  97.         </nav>
  98.         <header></header>
  99.         <main role="main">
  100.             {% for label, messages in app.flashes %}
  101.                 {% for message in messages %}
  102.                     <div class="alert alert-{{ label }} alert-dismissable">
  103.                         <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
  104.                         {{ message }}
  105.                     </div>
  106.                 {% endfor %}
  107.             {% endfor %}
  108.             {% if isPortal %}
  109.                 {{ block('content') }}
  110.             {% else %}
  111.                 <div id="content" class="container">
  112.                     <div class="row">
  113.                         {% set leftNavShow = document.getProperty('left_nav_show') %}
  114.                         {% set showBreadcrumbs = (hideBreadcrumbs is defined) ? not hideBreadcrumbs : true %}
  115.                         {% set mainColClass = leftNavShow ? 'col-md-9 pt-3 pt-md-5 order-last' : 'col-md-12 pt-3 pt-md-5' %}
  116.                         <div class="{{ mainColClass }}">
  117.                             {% if showBreadcrumbs %}
  118.                                 {% set mainNavStartNode = document.getProperty('navigation_root') %}
  119.                                 {% if mainNavStartNode is empty %}
  120.                                     {% set mainNavStartNode = pimcore_document(1) %}
  121.                                 {% endif %}
  122.                                 {% set breadbrumbs = pimcore_build_nav({
  123.                                     active: document,
  124.                                     root: mainNavStartNode
  125.                                 }) %}
  126.                                 {% do app_navigation_enrich_breadcrumbs(breadbrumbs) %}
  127.                                 {% do pimcore_nav_renderer('breadcrumbs').setMinDepth(null) %}
  128.                                 <div class="breadcrumb-header">
  129.                                     <a href="/">{{ "Home"|trans }}</a> &gt;
  130.                                     {{ pimcore_render_nav(breadbrumbs, 'breadcrumbs') }}
  131.                                 </div>
  132.                             {% endif %}
  133.                             {{ block('content') }}
  134.                         </div>
  135.                         {% if leftNavShow %}
  136.                             <div class="col-md-3 pt-3 pt-md-5 order-first sidebar">
  137.                                 <div class="sticky">
  138.                                     <div class="bs-sidebar hidden-print affix-top" role="complementary">
  139.                                         {% set leftStartNode = document.getProperty('left_nav_start_node') %}
  140.                                         {% if leftStartNode is empty %}
  141.                                             {% set leftStartNode = mainNavStartNode %}
  142.                                         {% endif %}
  143.                                         {% set leftNav = pimcore_build_nav({
  144.                                             active: document,
  145.                                             root: leftStartNode
  146.                                         }) %}
  147.                                         <h5>{{ leftStartNode.getProperty('navigation_name') }}</h5>
  148.                                         {{ pimcore_render_nav(leftNav, 'menu', 'renderMenu', {
  149.                                             ulClass: 'nav bs-sidenav',
  150.                                             expandSiblingNodesOfActiveBranch: true,
  151.                                         }) }}
  152.                                     </div>
  153.                                     {{ pimcore_inc(document.getProperty('sidebar')) }}
  154.                                 </div>
  155.                             </div>
  156.                         {% endif %}
  157.                     </div>
  158.                 </div>
  159.             {% endif %}
  160.             <a id="back-to-top" href="#" class="btn btn-primary btn-lg back-to-top" role="button" title="Click to return on the top" data-toggle="tooltip" data-placement="left">
  161.                 <span class="fa fa-arrow-up"></span>
  162.             </a>
  163.         </main>
  164.         {# include a document-snippet - in this case the footer document #}
  165.         {{ pimcore_inc(document.getProperty('footer')) }}
  166.         {# output scripts added before #}
  167.         {% block headscripts deferred %}
  168.             {{ pimcore_head_script() }}
  169.         {% endblock %}
  170.         {% block inlinescripts deferred %}
  171.             {{ pimcore_inline_script() }}
  172.         {% endblock %}
  173.     </body>
  174. </html>