src/WebBundle/Resources/views/Tile/index.html.twig line 1

Open in your IDE?
  1. {% extends '@Web/layout.html.twig' %}
  2. {% block title %}
  3.     {{ meta.title | raw }}
  4. {% endblock %}
  5. {% block extraGoogleTagScript %}
  6.     {{ include('@Web/google_gtag.html.twig') }}
  7. {% endblock %}
  8. {% block meta %}
  9.     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"/>
  10.     <meta name="keywords" content="{{ meta.keywords | raw }}"/>
  11.     <meta name="description" content="{{ meta.description | raw }}"/>
  12.     <meta property="og:type" content="website"/>
  13.     <meta property="og:title" content="{{ meta.title | raw }}"/>
  14.     <meta property="og:description" content="{{ meta.description | raw ~ ' ' ~ meta.specs | raw }}"/>
  15.     <meta property="og:image" content="{{ te.replaceStr('\\', '/', mainImage) }}"/>
  16.     <meta property="og:image:width" content="467"/>
  17.     <meta property="og:image:height" content="326"/>
  18.     <meta property="og:image:type" content="image/jpeg"/>
  19.     <meta property="og:locale" content="{{ te.locale.getCurLocaleISO() }}"/>
  20.     <meta property="og:url" content="{{ te.request.uri }}"/>
  21.     <meta property="og:site_name" content="Tile.Expert"/>
  22.     <meta name="Priority" content="1"/>
  23.     <meta name="locale" content="{{ te.locale.getCurLocaleISO() }}"/>
  24. {% endblock %}
  25. {% block stylesheets %}
  26.     {{ parent() }}
  27.     <link rel="stylesheet" href="{{ asset('_css/collection.min.css') }}"/>
  28.     <link href="{{ asset('build/stylesheets/common_components.css') }}" rel="stylesheet"/>
  29.     {% if ldJson %}
  30.         {% include '@Web/Tile/ldjson.html.twig' with { 'collection': initialState.collection } %}
  31.     {% endif %}
  32. {% endblock %}
  33. {% block javascripts %}
  34.     {{ parent() }}
  35.     {% if app.environment != 'test' and app.environment != 'te_dev' %}
  36.         <script
  37.             src='https://www.google.com/recaptcha/api.js?onload=onloadCallback&amp;render=explicit&amp;hl={{ userLocale() }}'
  38.             async="async"></script>
  39.         <script type="text/javascript">
  40.             var captchaComment;
  41.             var onloadCallback = function () {
  42.                 if (document.getElementById('captchaComment')) {
  43.                     captchaComment = grecaptcha.render('captchaComment', {
  44.                         'sitekey': '{{ recaptcha }}'
  45.                     });
  46.                 }
  47.             };
  48.         </script>
  49.     {% endif %}
  50.     <script src="{{ asset('build/client-bundle.js') }}"></script>
  51.     {% if te.checkIsDev %}
  52.         <script src="{{ asset('_js/collection-react.js') }}" defer></script>
  53.     {% else %}
  54.         <script src="{{ asset('_js/collection-react.min.js') }}"></script>
  55.     {% endif %}
  56. {% endblock %}
  57. {% block googleTagScript %}
  58.     {% if googleRemarketing is defined and googleRemarketing %}
  59.         {#  для страниц с реактом, возможно в TWIG-шаблоне останется только заглушка, а логика переместится в реакт! #}
  60.         <!-- tile:index -->
  61.         {% if initialState['collection'] is defined and initialState['collection']['name'] is defined and
  62.             initialState['collection']['itemsIdArray'] is defined %}
  63.             {% set collName = initialState['collection']['name'] %}
  64.             {% set collArtIds = initialState['collection']['itemsIdArray'] %}
  65.         {% endif %}
  66.     {% endif %}
  67. {% endblock %}
  68. {% block content %}
  69.     {% if initialState.liteMenu.collection.selected is not null %}
  70.     {# это костыль, чтобы выбранная фабрика в быстрых фильтрах попадала в состояние выбраых фильтров #}
  71.         <div
  72.             class="divDataFs"
  73.             data-filtersearch='{
  74.                 "collection": {{ initialState.liteMenu.collection.selected.id }},
  75.                 "factory": {{ initialState.liteMenu.collection.selected.factory.id }}
  76.             }'
  77.         ></div>
  78.     {% endif %}
  79.     {{ redux_store('appStore', initialState) }}
  80.     {{ react_component('App', {'rendering': te.parameter('react_rendering'), 'props': baseProps()}) }}
  81. {% endblock %}