templates/uniqskills/catalogue/course_catalogue.html.twig line 1

Open in your IDE?
  1. {% extends '/uniqskills/layout.html.twig' %}
  2. {% if category is defined
  3.     and category is not empty
  4.     and category.metaTags is not empty%}
  5.     {% if category.metaTags.title is not empty %}
  6.         {% set seoTitle = category.metaTags.title|raw %}
  7.     {% endif %}
  8.     {% if category.metaTags.description is not empty %}
  9.         {% set seoDescription = category.metaTags.description|raw %}
  10.     {% endif %}
  11.     {% if category.metaTags.headScripts is not empty %}
  12.         {% set seoHeadCode = category.metaTags.headScripts|raw %}
  13.     {% endif %}
  14.     {% if category.metaTags.bodyScripts is not empty %}
  15.         {% set seoBodyCode = category.metaTags.bodyScripts|raw %}
  16.     {% endif %}
  17. {% endif %}
  18. {% block title %}
  19.     {% if seoTitle is defined %}
  20.         {{ category.metaTags.title|raw }}
  21.     {% else %}
  22.         {{ 'uniqskills.metaTitle.courses'|trans }}
  23.     {% endif %}
  24. {% endblock %}
  25. {% block meta %}
  26.     {% if seoDescription is defined %}
  27.         <meta name="description" content="{{ category.metaTags.description|raw }}">
  28.     {% endif %}
  29. {% endblock %}
  30. {% block customcss %}
  31.     {% if seoHeadCode is defined %}
  32.         {{ category.metaTags.headScripts|raw }}
  33.     {% endif %}
  34. {% endblock %}
  35. {% block customjs %}
  36.     {% if seoBodyCode is defined %}
  37.         {{ category.metaTags.bodyScripts|raw }}
  38.     {% endif %}
  39.     {% if pagination|length > 0 %}
  40.         {% set coursesId = [] %}
  41.         {% for item in pagination %}
  42.             {% set coursesId = coursesId|merge([item.id]) %}
  43.         {% endfor %}
  44.         <script>{{ gaDataLayerUS('prod_impression', coursesId)|raw }}</script>
  45.     {% endif %}
  46. {% endblock %}
  47. {% block content %}
  48.     {% if category is not null and (category.bannerName is not null or category.bannerHtml is not null) %}
  49.         <div class="category-banner">
  50.             {% if category.bannerName is not null %}
  51.                 <a href="{{ category.bannerLink ?: '#' }}">
  52.                     <img src="{{ vich_uploader_asset(category, 'bannerFile') }}" alt="{{ category.categoryName }}">
  53.                 </a>
  54.             {% elseif category.bannerHtml is not null %}
  55.                 {{ category.bannerHtml|raw }}
  56.             {% endif %}
  57.         </div>
  58.     {% endif %}
  59.     {% if app.request.locale == 'pl' %}
  60.         {% set searchRoute = 'fmUniqskillsFrontendPlCatalogueSubCategory' %}
  61.     {% else %}
  62.         {% set searchRoute = 'fmUniqskillsFrontendCatalogueSubCategory' %}
  63.     {% endif %}
  64.     <div class="subpageContent">
  65.         <div class="container">
  66.             {% if app.request.server.get('DEFAULT_LOCALE') == 'pl'
  67.                 and "now"|date('Y-m-d') >= '2023-11-16'|date('Y-m-d')
  68.                 and "now"|date('Y-m-d') <= '2023-11-28'|date('Y-m-d') %}
  69.                 <img class="img-fluid subpageContent--courses-banner">
  70.             {% endif %}
  71.             <div class="headerWithSearch">
  72.                 <h1>{{ 'uniqskills.catalog.title'|trans }}</h1>
  73.                 <div class="headerWithSearch-search">
  74.                     <form id="searchAjax" class="catalog-ajax-search" method="GET" action="{{ path(searchRoute, {
  75.                         category: app.request.attributes.get('category'),
  76.                         subCategory: app.request.attributes.get('subCategory')
  77.                     }) }}">
  78.                         <input name="search"
  79.                                value="{{ app.request.get('search') }}"
  80.                                type="text"
  81.                                class="fm-search-bar fm-search-button"
  82.                                placeholder="{{ 'uniqskills.catalog.search'|trans }}" />
  83.                         <input type="submit" class="fmFilter" value="" />
  84.                     </form>
  85.                 </div>
  86.             </div>
  87.             {% include '/uniqskills/catalogue/course_catalogue_ajax.html.twig' %}
  88.         </div>
  89.     </div>
  90.     {% if ( (category.shortBody is defined and category.shortBody is not null) and (category.body is defined and category.body is not null) ) %}
  91.         <div class="categoryInfo">
  92.             <div class="container">
  93.                 <h4 class="categoryInfo__header">{{ category.shortBody }}</h4>
  94.                 <div class="categoryInfo__text-container">
  95.                     {{ category.body|raw }}
  96.                 </div>
  97.             </div>
  98.         </div>
  99.     {% endif %}
  100. {% endblock %}
  101. {# TODO: Check commented code #}
  102. {#{% block customjs %}#}
  103.     {#{% javascripts#}
  104.     {#'backend/global/scripts/app.min.js'#}
  105.     {#'@FmBaseBundle/Resources/public/js/base.js'#}
  106.     {#'@FmCourseBundle/Resources/public/js/courseCatalogue.js'#}
  107.     {#%}#}
  108.     {#<script src="{{ asset_url }}"></script>#}
  109.     {#{% endjavascripts %}#}
  110. {#{% endblock %}#}