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

Open in your IDE?
  1. {% import 'blocks\\macros.html.twig' as macros %}
  2. {% set _i = item|default({}) %}
  3. {% set title = _i.title|default(title|default(null)) %}
  4. {% set canonical_url = _i.canonical_url|default(friendlyUrl|default('#')) %}
  5. {% set image = _i.image|default(image|default(null)) %}
  6. {% set image_title = _i.image_title|default(image_title|default(title)) %}
  7. {% set start_date = _i.start_date|default(start_date|default(null)) %}
  8. {% set end_date = _i.end_date|default(end_date|default(null)) %}
  9. {% set location = _i.location|default(location|default(null)) %}
  10. {% set category = _i.category|default(category|default(null)) %}
  11. {% set live = live|default(false) %}
  12. {% set showiconplay = showiconplay|default(false) %}
  13. {% set i = i|default(null) %}
  14. {% set pageId = _i.id|default(id|default(null)) %}
  15. {% set pageInfo = get_page_info(app.request.locale, pageId, true, "Temas")|default(null) %}
  16. {% set categories = (pageInfo is not null and pageInfo.categories is defined) ? pageInfo.categories : [] %}
  17. {% set exclusiveTag = pageInfo and pageInfo.page.tags is defined ? pageInfo.page.tags|filter(t => t.domainValue.type.name == 'Exclusive')|first|default(null) : null %}
  18. {% set maxVisible = 1 %}
  19. <div class="col item">
  20.     <a href="{{ canonical_url }}" title="{{ title|default('Event Title ' ~ i|default('')) }}">
  21.         <div class="image-container event-card-carousel">
  22.             <picture>
  23.                 {% if image is empty %}
  24.                     {% set image = '/uploads/system/placeholder-vertical.png' %}
  25.                 {% endif %}
  26.                     <img src="{{ (image)|imagine_filter('list_event')|urldecode }}"
  27.                          loading="lazy"
  28.                          alt="{{ title|default('') }}"
  29.                          title="{{ image_title|default(title|default('')) }}">
  30.             </picture>
  31.             {% if showiconplay %}
  32.                 <div class="card card-blur icon">
  33.                     {{ file_get_contents(asset('custom/player-icon.svg', 'global'))|raw }}
  34.                 </div>
  35.             {% endif %}
  36.         </div>
  37.         <div class="caption">
  38.             {% if live %}
  39.                 <div class="live">
  40.                     <div class="d-flex align-items-center">
  41.                         {{ file_get_contents(asset('custom/breakingnews-icon.svg', 'global'))|raw }}
  42.                         <div class="ml-2">{{ 'live'|trans ({},'custom' )|html_entity_decode|raw }}</div>
  43.                     </div>
  44.                 </div>
  45.             {% endif %}
  46.             <h3 class="card-title">
  47.             {{ title is defined and title is not empty
  48.                 ? (title|length <= 80
  49.                     ? title
  50.                     : title|slice(0, 80) ~ '...')
  51.                 : 'Event Title ' ~ i|default('')
  52.             }}
  53.             </h3>
  54.             <div class="date">
  55.                 {% if start_date %}
  56.                     {{ format_event_range(start_date, end_date) }}
  57.                 {% endif %}
  58.             </div>
  59.             {% if location %}
  60.                 <div class="location">{{ location }}</div>
  61.             {% endif %}
  62. {#            {% if pageInfo.categories is defined %}#}
  63.                 {{ macros.renderCategoryPopover(categories, maxVisible, false, exclusiveTag, languagecode, 'categories-list') }}
  64. {#            {% endif %}#}
  65.         </div>
  66.     </a>
  67. </div>
  68. {#<script>#}
  69. {#    console.log({{ dump(pageInfo) }})#}
  70. {#</script>#}