cancel
Showing results for 
Search instead for 
Did you mean: 

Space Template readme.ftl not working in 2.2 Enterprise

invantix
Champ in-the-making
Champ in-the-making
I am using 2.2 Enterprise.

I tried the readme.ftl as a space template.  I placed a file readme.html in the space.  When I browse to the space I get an error.

Error during processing of the template 'Expression htmlFilename is undefined on line 1, column 363 in workspace ://SpacesStore/f344f52f-0d6a-11dd-bdf6-27fd4d2bd377.'. Please contact your system administrator.

Here is the script that is in Data Dictionary/Presentation Templates:


<#– Displays the contents of readme.html and/or the evaluated readme.ftl if they exist in the current space. –>

<#assign htmlFilename = "readme.html"/>
<#assign ftlFilename = "readme.ftl"/>

<#if space?exists>
<#if space.childByNamePath["${htmlFilename}"]?exists>
${space.childByNamePath[htmlFilename].content}
</#if>
<#if space.childByNamePath["${ftlFilename}"]?exists>
<#include space.childByNamePath["${ftlFilename}"].nodeRef>
</#if>
</#if>

1 REPLY 1

norgan
Champ in-the-making
Champ in-the-making
Hi ivantix,
with "space template", do you mean the custom view for the space ? My version below works fine. Could it be, that you have insufficient rights ?
<#– Displays the contents of readme.html and/or the evaluated readme.ftl if they exist in the current space. –>

<#assign htmlFilename = "readme.html"/>
<#assign ftlFilename = "readme.ftl"/>

<#if space?exists>
    <#if space.childByNamePath["${htmlFilename}"]?exists>
        ${space.childByNamePath[htmlFilename].content}
    <#elseif space.childByNamePath["${ftlFilename}"]?exists>
        <#include space.childByNamePath["${ftlFilename}"].nodeRef>
    <#else>
   Welcome in outer space at ${space.name}.
    </#if>
</#if>
Regards, Norgan