Use absolute URL in preview
authorThierry Florac <thierry.florac@onf.fr>
Fri, 25 May 2018 08:05:13 +0200
changeset 557 a78ade534b97
parent 556 8f3c10b301ea
child 558 d9c6b1d7fefa
child 652 b438528e5bb3
Use absolute URL in preview
src/pyams_content/features/preview/zmi/templates/preview.pt
--- a/src/pyams_content/features/preview/zmi/templates/preview.pt	Fri May 25 08:04:24 2018 +0200
+++ b/src/pyams_content/features/preview/zmi/templates/preview.pt	Fri May 25 08:05:13 2018 +0200
@@ -24,7 +24,8 @@
 				<tal:if condition="len(langs) == 1">
 					<div class="margin-top-10">
 						<iframe src="preview.html" frameborder="0" style="width: 100%;"
-								tal:attributes="src string:preview.html?lang=${langs[0]}"
+								tal:define="url extension:absolute_url(context, 'preview.html')"
+								tal:attributes="src string:${url}?lang=${langs[0]}"
 								onload="this.style.height = (jQuery(parent.window).height() - 150) + 'px'"></iframe>
 					</div>
 				</tal:if>
@@ -34,7 +35,8 @@
 							<li tal:define="active python:'active' if repeat['lang'].start() else ''"
 								tal:attributes="class string:small ${active}">
 								<a data-toggle="tab" class="xsmall"
-								   tal:attributes="href string:#preview-${lang}">
+								   tal:define="url extension:absolute_url(context, 'preview.html')"
+								   tal:attributes="src string:${url}?lang=${lang}">
 									<img tal:attributes="src string:/--static--/pyams_i18n/img/flags/${lang}.png" />
 								</a>
 							</li>
@@ -46,7 +48,8 @@
 								 tal:attributes="class string:clearfix tab-pane ${active} fade in padding-5;
 												 id string:preview-${lang};">
 								<iframe src="preview.html" frameborder="0" style="width: 100%;"
-										tal:attributes="src string:preview.html?lang=${lang}"
+										tal:define="url extension:absolute_url(context, 'preview.html')"
+										tal:attributes="src string:${url}?lang=${lang}"
 										onload="this.style.height = (jQuery(parent.window).height() - 150) + 'px'"></iframe>
 							</div>
 						</tal:loop>