From dfa97090fe1e8fa2f95fd21851e3f60e0dacc908 Mon Sep 17 00:00:00 2001
From: Chris Lawton <chris.lawton@torchbox.com>
Date: Tue, 13 Feb 2018 14:41:31 +0000
Subject: [PATCH] adding result icon as an image option with default fallback

---
 .../templates/search/includes/search_result.html     | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/opentech/public/search/templates/search/includes/search_result.html b/opentech/public/search/templates/search/includes/search_result.html
index 94919ee81..ad3477c26 100644
--- a/opentech/public/search/templates/search/includes/search_result.html
+++ b/opentech/public/search/templates/search/includes/search_result.html
@@ -17,11 +17,13 @@
         {% endif %}
     </h6>
 
-{% if result.listing_image %}
-    <a href="{% pageurl result %}">
-        {% image result.listing_image fill-450x300 %}
-    </a>
-{% endif %}
+    {% if result.listing_image or result.icon %}
+        {% image result.listing_image|default:result.icon fill-180x180 class="listing__image" %}
+    {% else %}
+        <div class="listing__image listing__image--default">
+            <svg><use xlink:href="#logo-mobile-no-text"></use></svg>
+        </div>
+    {% endif %}
 
 <h4>
     <a href="{% pageurl result %}">
-- 
GitLab