templates/ProfileList/list.profiles.html.twig line 1

Open in your IDE?
  1. {# {% set result = [] %} #}
  2. {# {% set isTopProfilesExist = top_profile is defined and null != top_profile and null != profiles %}
  3. {{dump( top_profile in profiles.array|keys )}}
  4. {% if isTopProfilesExist and top_profile in profiles.array|keys %}
  5.     {% set result = [] %}
  6.     {% for key, profile in profiles.array %}
  7.         {% if profile != top_profile %}
  8.             {% set result = result|merge([profile])%}
  9.         {% endif %}
  10.     {% endfor %}
  11.     {% set result = [top_profile]|merge(result) %}
  12. {% endif %}
  13. {{dump( result )}} #}
  14. {% set profiles_array = [] %}
  15. {% if profiles != null %}
  16.     {% if profiles.array is defined %}
  17.         {# Legacy listing provider #}
  18.         {% set profiles_array = profiles.array %}
  19.         {% if top_profile is defined and null != top_profile %}
  20.             {% set profiles_array = [top_profile]|merge(profiles_array) %}
  21.         {% endif %}
  22.     {% else %}
  23.         {# New listing microservice. Profiles array already contains top placement #}
  24.         {% set profiles_array = profiles %}
  25.     {% endif %}
  26. {% endif %}
  27. {% set hidePreferredButton = hidePreferredButton is defined ? hidePreferredButton : false %}
  28. {% set likeButton = likeButton is defined ? likeButton : false %}
  29. {%- for profile in profiles_array -%}
  30.     {%- set lazyLoad = loop.index == 1 -%}
  31.     {% include 'ProfileList/profile.html.twig' with {profile: profile, lazyLoad: lazyLoad} %}
  32. {%- endfor -%}