cancel
Showing results for 
Search instead for 
Did you mean: 

FTL Email Template Document Link

gmurphy
Champ on-the-rise
Champ on-the-rise
Folks,

I have an issue where I 'm creating a link to a document for an Email template and am getting a space in the URL link in the email sent to users that I cannot explain

In the FTL I imput the line below

http://localhost:8080/share/page/site/TaxAndDutyManuals/taxdutymanuallibrary#path=<@location manual/>&file=${manual.nodeRef?url}

and the result in the email is a space before /Master-Documents breaking the link


http://localhost:8080/share/page/site/taxdutymanual/taxdutymanuallibrary#path=   /Master-Documents/Collection
&file=workspace%3A%2F%2FSpacesStore%2Fed3d65e2-ddcc-450f-b8b5-5e7b8bfe90ab

Have you any idea what I might be doing wrong and how to resolve

Gerald
3 REPLIES 3

mikeh
Star Contributor
Star Contributor
What's in the @location macro?

Mike

gmurphy
Champ on-the-rise
Champ on-the-rise
Here is the Macro

<#macro location doc>
   <#assign qnamePaths = doc.qnamePath?split("/") />
   <#assign displayPaths = doc.displayPath?split("/") + [""] />
   <#if ((qnamePaths?size &gt; 5) && (qnamePaths[2] == "st:sites"))><#list displayPaths[5..] as path><#if path_has_next>/</#if>${path}</#list></#if>
</#macro>

which I have changed to

<#macro location doc>
<#assign qnamePaths=doc.qnamePath?split("/")/>
<#assign displayPaths=doc.displayPath?split("/")+[""]/>
<#if ((qnamePaths?size&gt;5)&&(qnamePaths[2]=="st:sites"))><#list displayPaths[5..]as path><#if path_has_next>/</#if>${path}</#list></#if>
</#macro>

and now have moved the break in the link in the email to a different part of the line See below

http://localhost:8080/share/page/site/taxdutymanual/taxdutymanuallibrary#path=/Master-Documents/Appe...
&file=workspace%3A%2F%2FSpacesStore%2F06d164e4-3c4e-4429-b831-bfcd78546c5c

It now breaks between /Appeals and &file= and the hightlighted link stops at /Appeals the rest is just text

I think its a rouge space

Gerald

mikeh
Star Contributor
Star Contributor
I suggest you change the macro to a function so you've got more control over the exact returned value. See http://freemarker.org/docs/ref_directive_function.html for details - it's pretty easy to swap between the two.

Thanks,
Mike