theme/templates/partials/elements/event-highlight.twig line 1

Open in your IDE?
  1. {% import 'blocks\\macros.html.twig' as macros %}
  2.    {% set publishDate = null %}
  3.     {% set expireDate = null %}
  4.     {% set see_tv_pageInfo = null %}
  5.     {% if highlightSeeTv|default %}
  6.         {% set tmpSeeTv = get_page_info(app.request.locale, highlightSeeTv) %}
  7.         {% if tmpSeeTv is not empty and tmpSeeTv.page is defined %}
  8.             {% set see_tv_pageInfo = tmpSeeTv %}
  9.             {% set publishDate = see_tv_pageInfo.page.publishDate is defined
  10.                 ? see_tv_pageInfo.page.publishDate|date("U")
  11.                 : null
  12.             %}
  13.             {% set expireDate = see_tv_pageInfo.page.expireDate is defined
  14.                 ? see_tv_pageInfo.page.expireDate|date("U")
  15.                 : null
  16.             %}
  17.         {% endif %}
  18.     {% endif %}
  19.     {% set exclusiveTag = null %}
  20.     {% if highlightPageInfo and highlightPageInfo.page is defined and highlightPageInfo.page.tags is defined and highlightPageInfo.page.tags|length > 0 %}
  21.         {% set exclusiveTag = highlightPageInfo.page.tags|filter(t => t.domainValue.type.name == 'Exclusive')|first|default(null) %}
  22.     {% endif %}
  23.     <div class="col-12 hightlight-event">
  24.         {% if see_tv_pageInfo is defined and publishDate is not null and expireDate is not null and now >= publishDate and now <= expireDate %}
  25.             <div class="live align-self-start">
  26.                 <div class="d-flex align-items-center">
  27.                     {{ file_get_contents(asset('custom/breakingnews-icon.svg', 'global'))|raw }}
  28.                     <div class="ml-2">{{ 'live'|trans ({},'custom' )|html_entity_decode|raw }} </div>
  29.                 </div>
  30.             </div>
  31.         {% endif %}
  32.         <div>
  33.             {% if highlightCategories|default %}
  34.                 {% set pageInfotags = highlightPageInfo.page is defined ? highlightPageInfo.page.tags : [] %}
  35.                 {% set exclusiveTag = pageInfotags|filter(t => t.domainValue.type.name == 'Exclusive')|first|default(null) %}
  36.                 {% set maxVisible = 2 %}
  37.                 {{ macros.renderCategoryPopover(highlightPageInfo.categories, maxVisible, false, exclusiveTag, languagecode, null, false) }}
  38.             {% endif %}
  39.         </div>
  40.         <h3>{{ highlightTitle|default|raw }}</h3>
  41.         <div class="description">
  42.             {{ highlightDescription|default|raw }}
  43.         </div>
  44.         <a href="{{highlightUrl|default}}" class="btn {{settings.btn_style_transmission|default('btn-secondary')}}">
  45.             <span>{{ 'tellme_more'|trans ({},'custom' )|html_entity_decode|raw }}</span>
  46.         </a>
  47.     </div>