app/Resources/views/article.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% import "macros/strossle.html.twig" as strossle %}
  3. {% use 'includes/blocks/articles.blocks.html.twig' %}
  4. {% set meta_title = (article.seoTitle ? article.seoTitle : article.title) %}
  5. {% set meta_descripton = article.seoDescription ? article.seoDescription : article.excerpt %}
  6. {% block title %}{{ meta_title }}{% endblock %}
  7. {% block head %}
  8.     {% if article.socialThumbnail == true %}
  9.         {% set thumbnail = asset(article.uploadPath ~ 'thumbnail/social.jpg', 'static') %}
  10.         {% set thumbnail_file = article.uploadPath ~ 'thumbnail/social.jpg' %}
  11.     {% else %}
  12.         {% set thumbnail = get_thumbnail(article.uploadPath ~ 'thumbnail/620x300.jpg') %}
  13.         {% set thumbnail_file = article.uploadPath ~ 'thumbnail/620x300.jpg' %}
  14.     {% endif %}
  15.     <meta name="description" content="{{ meta_descripton }}">
  16.     <meta name="twitter:card" content="summary">
  17.     <meta name="twitter:title" content="{{ meta_title }}">
  18.     <meta name="twitter:description" content="{{ meta_descripton }}">
  19.     <meta name="twitter:image" content="{{ thumbnail }}?v={{ file_mtime(thumbnail_file) }}">
  20.     <meta name="twitter:url" content="{{ site_url ~ 'clanok/' ~ article.id ~ '-' ~ article.slug }}">
  21.     <meta property="og:type" content="article">
  22.     <meta property="og:title" content="{{ meta_title }}">
  23.     <meta property="og:description" content="{{ meta_descripton }}">
  24.     <meta property="og:image" content="{{ thumbnail }}?v={{ file_mtime(thumbnail_file) }}">
  25.     <meta property="og:url" content="{{ site_url ~ 'clanok/' ~ article.id ~ '-' ~ article.slug }}">
  26. {% endblock %}
  27. {% block footer %}
  28.     {% if custom_js is defined and custom_js is not empty %}
  29.         {% for item in custom_js %}
  30.             {{ item|raw }}
  31.         {% endfor %}
  32.     {% endif %}
  33. {% endblock %}
  34. {% block content %}
  35.     <section class="bg-frLightBlue section-pt">
  36.         <main-article-data
  37.             :data="JSON.parse('{{ mainArticleData|json_encode|e('js') }}')"
  38.         ></main-article-data>
  39.         {% for item in article.content %}
  40.             {% include 'includes/content/' ~ item.type ~ '.html.twig' %}
  41.         {% endfor %}
  42.         {% if relatedArticles|length > 0 %}
  43.             <div class="bg-frLightBlue">
  44.                 <section-title
  45.                     class="mid-section-pb"
  46.                     :data="{
  47.                         type: 'secondary',
  48.                         theme: 'light',
  49.                         title: 'Odporúčame',
  50.                         image: '{{ asset('vue/icons/flash.svg', 'img') }}',
  51.                         imageClass: 'w-10 lg:w-15'
  52.                     }"
  53.                 ></section-title>
  54.             </div>
  55.             {% set items = relatedArticles %}
  56.             {{ block('infinite_scroll_small_articles') }}
  57.         {% endif %}
  58.     </section>
  59.     {# IAB GDPR consent #}
  60.     {% if article.id == 'iab_consent_recall_article_id'|get_option_value %}
  61.         <script id="CookieDeclaration" src="https://consent.cookiebot.com/6fd8ebbc-4e40-40ab-92ce-bac2f16378d6/cd.js" type="text/javascript" async></script>
  62.     {% endif %}
  63. {% endblock %}