Remove H2 tag when title is empty
authorThierry Florac <thierry.florac@onf.fr>
Fri, 05 Oct 2018 13:20:35 +0200
changeset 163 de718ccf8bcc
parent 162 77ec84eff41c
child 164 d02350fa13e7
Remove H2 tag when title is empty
src/pyams_default_theme/component/paragraph/templates/html-default.pt
--- a/src/pyams_default_theme/component/paragraph/templates/html-default.pt	Wed Oct 03 19:27:17 2018 +0200
+++ b/src/pyams_default_theme/component/paragraph/templates/html-default.pt	Fri Oct 05 13:20:35 2018 +0200
@@ -2,7 +2,7 @@
 				 position renderer.position if renderer is not None else None;"
 		 switch="position">
 	<tal:var case="'before-title'">${structure:view.render_illustration()}</tal:var>
-	<h2 tal:condition="position != 'before-title'">${view.title}</h2>
+	<h2 tal:condition="view.title and (position != 'before-title')">${view.title}</h2>
 	<tal:var case="'before-body'">${structure:view.render_illustration()}</tal:var>
 	<div>${structure:tales:html(view.body, 'oid_to_href')}</div>
 	<tal:var case="'after-body'">${structure:view.render_illustration()}</tal:var>