AnsweredAssumed Answered

issues when overriding wiki-page.ftl alfresco 5.1

Question asked by vincent-kali on Aug 24, 2016
I'm trying to customize the standard wiki page to remove header, footer and toolbar when calling page with argument 'forIframe'.
I added a share module to override wiki-page.ftl Template.

Content of extension file:




<extension>
   <modules>
      <module>
      <id>KS2 iFrame for WIKI</id>
      <version>2.0.4</version>
      <auto-deploy>true</auto-deploy>
      <customizations>
         <customization>
            <targetPackageRoot>org.alfresco</targetPackageRoot>
            <sourcePackageRoot>fr.ks2.alfresco.wiki</sourcePackageRoot>
         </customization>
      </customizations>
      </module>
   <modules>
<extension>



Content of custom wiki-page.ftl:
If 'forIframe' argument is defined, I just want to hide header (@markup id="alf-hd" in the original Template), toolbar (<@region id="toolbar" in the original Template) and footer (@markup id="alf-ft" in the original Template).



<#assign forIframe = page.url.args.forIframe??>
   <@markup id="ks2-wiki-template-alf-hd-with-iFrameSupport" target="alf-hd" action="replace" scope="global">
      <div id="alf-hd">
        <#if !forIframe>
            <@region scope="global" id="share-header" chromeless="true"/>
         </#if>
      </div>
   </@>
      <@markup id="ks2-wiki-template-bd-with-iFrameSupport" target="bd" action="replace" scope="global">
      <div id="bd">
        <#if !forIframe>
         <@region id="toolbar" scope="template" />
         </#if>
        <@region id="wikipage" scope="template" />
      </div>
   </@>
   <@markup id="ks2-wiki-template-alf-ft-with-iFrameSupport" target="alf-ft" action="replace" scope="global">
      <div id="alf-ft">
        <#if !forIframe>
        <@region id="footer" scope="global" />
         </#if>
      </div>
   </@>


This is working fine when modifying wiki-page.ftl source file directly, but when using customization above, the page is not rendered without any error.
After some testing, the found that method above is working fine when applied to toolbar and footer, but when applied to header, page is just not rendered.
Any advice ?

Original wiki-page.ftl :


<#include "include/alfresco-template.ftl" />
<@templateHeader>
   <@templateHtmlEditorAssets /> 
</@>

<@templateBody>
   <@markup id="alf-hd">
   <div id="alf-hd">
      <@region scope="global" id="share-header" chromeless="true"/>
   </div>
   </@>
   <@markup id="bd">
   <div id="bd">
      <@region id="toolbar" scope="template" />
      <@region id="wikipage" scope="template" />
   </div>
   </@>
</@>

<@templateFooter>
   <@markup id="alf-ft">
   <div id="alf-ft">
      <@region id="footer" scope="global" />
   </div>
   </@>
</@>



Thanks,

Outcomes