Thanks for your assistance could you explain in more detail where
{% set query = request.query_dict.q|lower %} should be placed.
Also I have added the last part of the code in the listing template underneath the existing code that builds out the page is this correct?
EXISTING CODE
<div class="blog-section portfolio">
<div class="blog-listing-wrapper cell-wrapper">
<div class="row same-height-parent isotope" style="display:flex; flex-wrap:wrap;">
{% for content in contents %}
<div class="span4 resource-listing-thumb original inspire-site {{ content.widgets.filter.body.value }} {{ content.widgets.resource_type.body.value }}">
<!--<a href="{{ content.absolute_url }}" class="inspire-block"> -->
<a href="{{ content.widgets.resource_link.body.value }}" class="inspire-block">
<div class="portfolio-image-wrapper">
<img class="portfolio-image" src="{{ content.widgets.thumbnail_image.body.src }}" alt="{{ content.widgets.listingimage.body.alt }}" />
<!--<span class="cta orange">See More</span> -->
</div>
<!--<span class="portfolio-title same-height"> {{ content.name}} </span> -->
<h4>{{content.name }}</h4
</a>
</div>
{% endfor %}
NEW CODE ADDED
{% if query is defined %}
{% for content in contents %}
{% set title = content.widgets.resource_title.body.value|lower %}
{% set type = content.widgets.resource_content_type.body.value|lower %}
{% set summary = content.widgets.resource_content_type.body.value|lower %}
{% set topic = in content.topic_list|map('name')|lower %}
{%if query in title or query in type or query in summary or query in topic %}
<div class="resource_item {{ content.widgets.resource_content_type.body.value|lower }}">
<a class="resource_featured_image" href="{{ content.widgets.resource_link.body.value }}" style="background: url({{ content.widgets.resource_image.body.src }});"></a>
<h2><a href="{{ content.widgets.resource_link.body.value }}">{{ content.widgets.resource_title.body.value }}</a></h2>
<div class="sum_wrap">
{{ content.widgets.resource_summary.body.value }}
</div>
<a class="resource_read_more" href="{{ content.widgets.resource_link.body.value }}">{{ content.widgets.resource_button_text.body.value }}</a>
</div>
{% endif %}
{% endfor %}
{% endif %}
</div>
So the code for the listing page is:
<div class="blog-section portfolio">
<div class="blog-listing-wrapper cell-wrapper">
<div class="row same-height-parent isotope" style="display:flex; flex-wrap:wrap;">
{% for content in contents %}
<div class="span4 resource-listing-thumb original inspire-site {{ content.widgets.filter.body.value }} {{ content.widgets.resource_type.body.value }}">
<!--<a href="{{ content.absolute_url }}" class="inspire-block"> -->
<a href="{{ content.widgets.resource_link.body.value }}" class="inspire-block">
<div class="portfolio-image-wrapper">
<img class="portfolio-image" src="{{ content.widgets.thumbnail_image.body.src }}" alt="{{ content.widgets.listingimage.body.alt }}" />
<!--<span class="cta orange">See More</span> -->
</div>
<!--<span class="portfolio-title same-height"> {{ content.name}} </span> -->
<h4>{{content.name }}</h4
</a>
</div>
{% endfor %}
{% if query is defined %}
{% for content in contents %}
{% set title = content.widgets.resource_title.body.value|lower %}
{% set type = content.widgets.resource_content_type.body.value|lower %}
{% set summary = content.widgets.resource_content_type.body.value|lower %}
{% set topic = in content.topic_list|map('name')|lower %}
{%if query in title or query in type or query in summary or query in topic %}
<div class="resource_item {{ content.widgets.resource_content_type.body.value|lower }}">
<a class="resource_featured_image" href="{{ content.widgets.resource_link.body.value }}" style="background: url({{ content.widgets.resource_image.body.src }});"></a>
<h2><a href="{{ content.widgets.resource_link.body.value }}">{{ content.widgets.resource_title.body.value }}</a></h2>
<div class="sum_wrap">
{{ content.widgets.resource_summary.body.value }}
</div>
<a class="resource_read_more" href="{{ content.widgets.resource_link.body.value }}">{{ content.widgets.resource_button_text.body.value }}</a>
</div>
{% endif %}
{% endfor %}
{% endif %}
</div>
<hr >
<div class="blog-pagination">
{% if contents.total_page_count > 0 %}
{% if widget.range == 10 %}
{% set base = 10 %}
{% set loop_ = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] %}
{% else %}
{% set base = 5 %}
{% set loop_ = ['1', '2', '3', '4', '5'] %}
{% endif %}
{% set current_pg_index = last_page_num + 1 %}
{% set range_start = ((1 - current_pg_index) % base) + current_pg_index %}
{# EXTRA: calculate start of previous range and end of next
{% set range_end = range_start + (base)-1 %}
{% set previous_range_start = ((6 - current_pg_index) % base) + current_pg_index - base %}
{% if previous_range_start < 1 %}
{% set previous_range_start = 1 %}
{% endif %}
#}
<ul>
<li class="first-posts-link {% if current_pg_index <= 1 %}hide{% endif %}"><a href="{{ blog_page_link(1) }}"><i class="fa fa-angle-double-left"></i></a></li>
<li class="previous-posts-link {% if !last_page_num %}hide{% endif %}"><a href="{{ blog_page_link(last_page_num) }}"><i class="fa fa-angle-left"></i></a></li>
<span class="pg">
{% set i = range_start %}
{% for pg in loop_ %} {# effectively, for i=1 to i=base #}
{% if i <= contents.total_page_count %}
<li{% if i == current_pg_index %} class="active"{% endif %}><a href="{{ blog_page_link(i) }}">{{ i }}</a></li>
{% set i = i + 1 %}
{% endif %}
{% endfor %}
</span>
<li class="next-posts-link {% if current_pg_index == contents.total_page_count %}hide{% endif %}"><a href="{{ blog_page_link(next_page_num) }}"><i class="fa fa-angle-right"></i></a></li>
<li class="last-posts-link {% if current_pg_index == contents.total_page_count %}hide{% endif %}"><a href="{{ blog_page_link(contents.total_page_count) }}"><i class="fa fa-angle-double-right"></i></a></li>
</ul>
{% endif %}
</div>
</div>
</div>