src/Hitso/Bundle/ContentBundle/Resources/views/Front/Article/show.html.twig line 55

Open in your IDE?
  1. {% extends 'HitsoCommonBundle::layout.html.twig' %}
  2. {% set related = related_articles(article, 4) %}
  3. {% block stylesheets %}
  4.     {{ parent() }}
  5.     <link rel="stylesheet" href="{{ asset('bundles/hitsocommon/hitsox-default-theme/source/css/article-critical.css') }}">
  6.     <link rel="preload" as="style" href="{{ preload(asset('bundles/hitsocommon/hitsox-default-theme/source/css/article-critical.css')) }}">
  7.     <link rel="preload" href="{{ preload(asset('bundles/hitsocommon/hitsox-default-theme/source/css/article.css')) }}" as="style" onload="this.onload=null;this.rel='stylesheet'">
  8. {% endblock %}
  9. {% block body_class %}{{ parent() }} page--article{% endblock %}
  10. {% block content %}
  11.     <main class="main">
  12.         {% cache cache_hash('article_main_' ~ article.version) {time: 3600} %}
  13.         <article class="article">
  14.             {% block articleMeta %}{% endblock %}
  15.             {% block articleHeader %}
  16.             {% set dateRendered = article.publishedAt|localizeddate('none', 'none', sites.current.locale, null, "d MMMM Y 'godz.' hh:mm") %}
  17.                 <div class="article__head">
  18.                     <h1 class="article__head-title" itemprop="name headline" id="article_title">
  19.                     {{ article.title }}
  20.                 </h1>
  21.                 <div class="article__meta">
  22.                     <!-- authors -->
  23.                     {% if article.authors|length > 0 %}
  24.                         {% for contentAuthor in article.authors %}
  25.                             {% if contentAuthor.user is defined %}{% set author = contentAuthor.user %}{% else %}{% set author = contentAuthor.author %}{% endif %}
  26.                             <div class="article__author" itemscope itemprop="author" itemtype="http://schema.org/Person">
  27.                                 {% if author is not null %}
  28.                                     {% if author.avatar is not null %}
  29.                                         <div class="article__author-avatar"></div>
  30.                                     {% endif %}
  31.                                     <span class="article__author-name" itemprop="name">{% spaceless %}{{ contentAuthor.header }} {{ author.name }}{% endspaceless %}</span>
  32.                                 {% endif %}
  33.                             </div>
  34.                         {% endfor %}
  35.                     {% endif %}
  36.                     <!-- publication date -->
  37.                     <time class="article__meta-date">{{ dateRendered }}</time>
  38.                 </div>
  39.             </div>
  40.             {% endblock %}
  41.             {% block articleCover %}
  42.             <div class="article__photo">
  43.                 {% if article.photo is not empty %}
  44.                     {% set imageUrl = article.photo|image_url('content_cover') %}
  45.                     {% set altText = article.photoAlt|default %}
  46.                     <picture class="article__photo-picture">
  47.                         <source media="(max-width: 360px)" srcset="{{ article.photo|image_url('content_cover_small') }}">
  48.                         <source media="(max-width: 760px)" srcset="{{ article.photo|image_url('content_cover_medium') }}">
  49.                         <source media="(max-width: 1024px)" srcset="{{ article.photo|image_url('content_cover_large') }}">
  50.                         <img class="article__photo-img" itemprop="image" alt="{{ altText }}" src="{{ imageUrl }}"/>
  51.                     </picture>
  52.                     {% if article.photoCaption is not empty %}
  53.                         <div class="article__photo-caption">
  54.                             {{ article.photoCaption }}
  55.                         </div>
  56.                     {% endif %}
  57.                 {% endif %}
  58.             </div>
  59.             {% endblock %}
  60.             {% block articleLead %}
  61.             <div class="article__lead">
  62.                 <p>
  63.                     {{ article.lead|raw }}
  64.                 </p>
  65.             </div>
  66.             {% endblock %}
  67.             {% block articleContent %}
  68.                 <div class="article__content">
  69.                     {% for element in article.elements %}
  70.                         {% include "HitsoContentBundle:Front/Article/Elements:#{element.typeName}.html.twig" %}
  71.                     {% endfor %}
  72.                 </div>
  73.             {% endblock %}
  74.             {% block articleFooter %}
  75.             {% set dateRendered = article.publishedAt|localizeddate('none', 'none', sites.current.locale, null, "d MMMM Y 'godz.' hh:mm") %}
  76.             <!-- article footer -->
  77.             <div class="article__footer">
  78.                 <div class="article__meta">
  79.                     <!-- author -->
  80.                     {% if article.authors|length > 0 %}
  81.                         {% for contentAuthor in article.authors %}
  82.                             {% if contentAuthor.user is defined %}{% set author = contentAuthor.user %}{% else %}{% set author = contentAuthor.author %}{% endif %}
  83.                             <div class="article__author">
  84.                                 {% if author is not null %}
  85.                                     {% if author.avatar is not null %}
  86.                                         <div class="article__author-avatar"></div>
  87.                                     {% endif %}
  88.                                     <span class="article__author-name">{% spaceless %}{{ contentAuthor.header }} {{ author.name }}{% endspaceless %}</span>
  89.                                 {% endif %}
  90.                             </div>
  91.                         {% endfor %}
  92.                     {% endif %}
  93.                     <!-- publication date -->
  94. {#                    <time class="article__meta-date">{{ dateRendered }}</time>#}
  95.                 </div>
  96.             </div>
  97.             {% endblock %}
  98.             {% block articleComments %}
  99. {#                {% if article.commentAllowed %}#}
  100. {#                    {% include 'HitsoContentBundle:Front/Article/Partials:comments.html.twig' %}#}
  101. {#                {% endif %}#}
  102.             {% endblock %}
  103.             {{ json_ld(article) }}
  104.         </article>
  105.         {% endcache %}
  106.         {% block related_articles %}
  107. {#            {% if related.count %}#}
  108. {#            <!-- hr -->#}
  109. {#            <div class="section-hr"></div>#}
  110. {#            <!-- entries showcase -->#}
  111. {#            <section class="entries_showcase">#}
  112. {#                <div class="entries_showcase__header">#}
  113. {#                    <div class="section section--center">#}
  114. {#                        <h2 class="section-title section-title--h1">#}
  115. {#                            Want to know more about us?#}
  116. {#                        </h2>#}
  117. {#                        <p class="section-lead">#}
  118. {#                            Visit our blog and learn more about technology and hitso#}
  119. {#                        </p>#}
  120. {#                    </div>#}
  121. {#                </div>#}
  122. {#                <div class="entries_showcase__grid entries" itemscope itemtype="http://schema.org/ItemList">#}
  123. {#                    {% for entry in related %}#}
  124. {#                        <div class="entry" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">#}
  125. {#                            <meta itemprop="position" content="{{ loop.index }}"/>#}
  126. {#                            <a href="{{ dynamic_url(entry.route.id) }}" class="entry__body" itemprop="url">#}
  127. {#                                {% if entry.photo is not empty %}#}
  128. {#                                    {% set imageUrl = entry.photo|image_url('content_cover') %}#}
  129. {#                                    {% set altText = entry.photo.altText|default %}#}
  130. {#                                    <picture class="entry__photo">#}
  131. {#                                        <img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="{{ imageUrl }}" class="entry__photo-img lazyload" alt="{{ entry.title }}"/>#}
  132. {#                                    </picture>#}
  133. {#                                {% endif %}#}
  134. {#                                <div class="entry__content">#}
  135. {#                                    <time class="entry__content-time" datetime="{{ entry.publishedAt|date('Y-m-d') }}">{{ entry.publishedAt|localizeddate('medium', 'none', app.request.locale) }}</time>#}
  136. {#                                    <strong class="entry__content-title" itemprop="name">#}
  137. {#                                        {{ entry.title }}#}
  138. {#                                    </strong>#}
  139. {#                                    <div class="entry__content-lead">#}
  140. {#                                        {{ entry.lead|striptags }}#}
  141. {#                                    </div>#}
  142. {#                                </div>#}
  143. {#                            </a>#}
  144. {#                        </div>#}
  145. {#                    {% endfor %}#}
  146. {#                </div>#}
  147. {#                <a href="{{ dynamic_url(article.category.route.id) }}" class="entries_showcase-cta btn btn--warning">visit our blog</a>#}
  148. {#            </section>#}
  149. {#            {% endif %}#}
  150.         {% endblock %}
  151.         {% block contact %}
  152. {#            {% include 'HitsoContentBundle:Front/Article/Partials:contact.html.twig' %}#}
  153.         {% endblock %}
  154.     </main>
  155. {% endblock %}
  156. {% block meta %}
  157.     {{ parent() }}
  158.     {% for entry in related %}
  159.         <meta property="og:see_also" content="{{ absolute_dynamic_url(entry.route.id) }}" />
  160.     {% endfor %}
  161. {% endblock %}
  162. {% block footer_javascripts %}
  163. {#    <script src="{{ asset('bundles/hitsocommon/hitsox-default-theme/source/js/article.js') }}"></script>#}
  164. {% endblock %}