{% for research in matchedResearches | slice(0,10) %} {% set tags = research.tags %} {% set tagSlug = [] %} {% for tags in research.tags %} {% set tagSlug = tagSlug|merge([tags.slug]) %} {% endfor %} {% if app.request.locale == 'en' %} {% set length = research.arabicAbstract|length %} {% else %} {% set length = research.englishAbstract|length %} {% endif %} {% set contributers = research.researchContributersRoles %}
{{ research.hits~' -'}} {% if contributers|length >1 %} {{ contributers[0] }} {% for i in range(1,contributers|length -1) %} , {{ contributers[i] }} {% endfor %} {% elseif contributers|length >0 %} {{ contributers[0] }} {% endif %} {% if research.publisher is not null and research.publisher.arabicFullName|length >1%} {% if contributers|length >0 %} {{ '-' }} {% endif %} {{(app.request.locale == 'ar')?research.publisher.arabicFullName:research.publisher.englishFullName}} {% elseif research.textualPublisher is not null and research.textualPublisher|length >1%} {% if contributers|length >0 %} {{ '-' }} {% endif %} {{research.textualPublisher}} {% endif %} {{ research.publicationDate|date('Y') }} {% if research.researchCategory is not null %} {{ "(" ~ (app.request.locale == 'ar')?research.researchCategory.arabicFullName:research.researchCategory.englishFullName ~ ")" }} {% endif %}
{% if length >300 %}
{% if app.request.locale == "en" and research.englishAbstract != null and research.englishAbstract != ""%} {{ research.englishAbstract[0:250] }} {{ research.englishAbstract[250:] }} {% else %} {{ research.arabicAbstract[0:250] }} {{ research.arabicAbstract[250:] }} {% endif %}
{% else %}
{% if app.request.locale == "en" and research.englishAbstract != null and research.englishAbstract != ""%} {{ research.englishAbstract }} {% else %} {{ research.arabicAbstract }} {% endif %}
{% endif %}
{% set break= false %} {% set len= tags|length %} {% if len > 0 %} {% set threshold=5 %} {% for i in range(0,len-1) %} {% if tagSlug!="" %} {% if i <= threshold %} {{ tags[i] }} {% elseif i > threshold %} {% set break=true %} {{ tags[i] }} {% endif %} {% else %} {% set threshold=threshold+1 %} {% endif %} {% endfor %} {% if break %}  {{ 'المزيد..' }} {% endif %} {% endif %}
{% endfor %}