result search modular

This commit is contained in:
2019-11-28 18:00:43 +01:00
parent d5807b0566
commit fd6809ed0e
5 changed files with 78 additions and 23 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -144,7 +144,8 @@
.search-results{ .search-results{
.results{ .results{
margin-top: 6rem; margin-top: 6rem;
display: inline-flex; @include flexbox;
align-items: flex-end;
width: 100%; width: 100%;
.search-row{ .search-row{
width: calc((100% / 12) * 6); width: calc((100% / 12) * 6);
@@ -174,6 +175,7 @@
.search-image{ .search-image{
width: 100%; width: 100%;
margin-top: 1.5rem; margin-top: 1.5rem;
margin-bottom: 1.5rem;
} }
} }
} }
@@ -184,6 +184,17 @@ h2{
} }
} }
.search-results{
.results{
display: block!important;
.search-row{
width: 100%!important;
padding: 0!important;
margin-bottom: 10px;
}
}
}
} }
@media screen and (max-width: 440px) { @media screen and (max-width: 440px) {
@@ -1,4 +1,43 @@
<section class="search-row"> {% if page.template == 'modular' %}
{% for item in page.collection %}
{% set value = query|hyphenize %}
{% set title = item.title|hyphenize %}
{% if title|contains(value) == 1 %}
<section class="search-row">
<a href="{{page.url}}">
{% set banner = item.media.images|first %}
<div class="search-item">
<div class="search-title">
{% include 'partials/blog/title.html.twig' with {title_level: 'h2', page: item} %}
</div>
<div class="search-details">
{% include 'partials/blog/date.html.twig' with {page: item} %}
</div>
{% if banner %}
<div class="search-image">
{{banner.cropZoom(800, 500).sizes('(max-width:100vw) 100vw, 50vw').html(item.title, 'image article')}}
</div>
{% endif %}
</div>
</a>
</section>
{% endif %}
{% endfor %}
{% else %}
<section class="search-row">
<a href="{{page.url}}"> <a href="{{page.url}}">
@@ -23,5 +62,6 @@
</div> </div>
</a> </a>
</section>
</section> {% endif %}