templates/includes/html/head.html.twig line 1

Open in your IDE?
  1. <!-- Required meta tags -->
  2. <meta charset="utf-8">
  3. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  4. {# add global stylesheets and scripts outside of any blocsk to add them to the helpers before any others assets are added #}
  5. {# we use the view helper to have cache buster functionality #}
  6. {% do pimcore_head_link().appendStylesheet('https://use.fontawesome.com/releases/v6.4.2/css/all.css') %}
  7. {% do pimcore_head_link().appendStylesheet(asset('https://unpkg.com/magnific-popup@1.1.0/dist/magnific-popup.css'), 'screen') %}
  8. {% 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"}) %}
  9. {% 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"}) %}
  10. {% 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"}) %}
  11. {% do pimcore_head_script().appendFile(asset('https://unpkg.com/magnific-popup@1.1.0/dist/jquery.magnific-popup.js')) %}
  12. {% if not document is defined or not document %}
  13. {% set document = pimcore_document(1) %}
  14. {% endif %}
  15. {% if document is instanceof('\\Pimcore\\Model\\Document\\Link') %}
  16. {# @var document \Pimcore\Model\Document\Link #}
  17. {% set document = document.getObject() %}
  18. {% endif %}
  19. {% if document is instanceof('\\Pimcore\\Model\\Document\\Page') %}
  20. {% if document.getTitle() is not empty %}
  21.   {% do pimcore_head_title().set(document.getTitle()) %}
  22. {% endif %}
  23. {% if document.getDescription() is not empty %}
  24.   {% do pimcore_head_meta().setDescription(document.getDescription()) %}
  25. {% endif %}
  26. {% do pimcore_head_title().append(pimcore_site_is_request() ? pimcore_site_current().rootDocument.title: document.title) %}
  27. {% do pimcore_head_title().setSeparator(' : ') %}
  28. {% endif %}
  29. {# favicon #}
  30. {% if document.getProperty('favicon') %}
  31.   {% set favicon_base = "/static/favicon/" ~ document.getProperty('favicon') %}
  32.   <link rel="icon" sizes="32x32" href="{{favicon_base}}/favicon.ico" />
  33.   <link rel="icon" sizes="192x192" href="{{favicon_base}}/android-chrome-192x192.png" />
  34.   <link rel="apple-touch-icon-precomposed" sizes="180x180" href="{{favicon_base}}/apple-touch-icon.png" />
  35.   <link rel="apple-touch-icon-precomposed" href="{{favicon_base}}/apple-touch-icon.png" />
  36. {% endif %}
  37. {# we're using the deferred extension here to make sure this block is rendered after all helper calls #}
  38. {% block layout_head_meta deferred %}
  39.     {{ pimcore_head_title() }}
  40.     {{ pimcore_head_meta() }}
  41.     {% if pimcore_placeholder('canonical').count() %}
  42.       <link rel="canonical" href="{{ pimcore_placeholder('canonical') }}"/>
  43.     {% endif %}
  44. {% endblock %}
  45. {% block head_stylesheets deferred %}
  46.   {{ pimcore_head_link() }}
  47.   {{ encore_entry_link_tags('global') }}
  48.   {% for file in encore_entry_js_files('global') %}
  49.     <script src="{{ asset(file) }}" defer></script>
  50.   {% endfor %}
  51.   {% if editmode %}
  52.     {{ encore_entry_link_tags('editmode') }}
  53.     {% for file in encore_entry_js_files('editmode') %}
  54.       <script src="{{ asset(file) }}" defer></script>
  55.     {% endfor %}
  56.   {% else %}
  57.     {{ encore_entry_link_tags('frontend') }}
  58.     {% for file in encore_entry_js_files('frontend') %}
  59.       <script src="{{ asset(file) }}" defer></script>
  60.     {% endfor %}
  61.   {% endif %}
  62. {% endblock %}