Added check againt missing map or image
authorThierry Florac <thierry.florac@onf.fr>
Thu, 19 Jul 2018 10:38:08 +0200
changeset 863 edcf61caaf3b
parent 862 617532ab2dab
child 864 209432f09f9f
Added check againt missing map or image
src/pyams_content/shared/imagemap/zmi/templates/imagemap-preview.pt
--- a/src/pyams_content/shared/imagemap/zmi/templates/imagemap-preview.pt	Wed Jul 18 16:37:17 2018 +0200
+++ b/src/pyams_content/shared/imagemap/zmi/templates/imagemap-preview.pt	Thu Jul 19 10:38:08 2018 +0200
@@ -1,8 +1,11 @@
 <div class="form-group" i18n:domain="pyams_content">
 	<div class="col-md-3"><!-- empty marker --></div>
 	<div class="col-md-9">
-		<img tal:define="map context.get_target();
-						 image i18n:map.image;"
-			 tal:attributes="src tales:absolute_url(image, '++thumb++600x480')" />
+		<tal:if define="map context.get_target()"
+				condition="map is not None">
+			<img tal:define="image i18n:map.image;"
+				 tal:condition="image"
+				 tal:attributes="src tales:absolute_url(image, '++thumb++600x480')" />
+		</tal:if>
 	</div>
 </div>