Document template : get all a document path with "Title" and not "name"


I would like do the same as : Xhtml : get all a document path with “Title” and not “name” but in document template (Code in freemarker) for email, pdf, xls extraction.

So I got a “Document” in my template and need to write it's path, not with the classic “name”, but with the “title” attribute of each element of the path.

Do you know how to do it ?

thank you

0 votes

1 answers



I used a function, as I could :

<#function getPathWithTitle doc>
    <#local tabPath = doc.path?split("/") >
    <#local pathSize = tabPath?size >
    <#local currentDoc = doc >
    <#local resultPath ="" >
    <#list 1..pathSize-1 as i>
            <#local theDoc = currentDoc.parent >
            <#local resultPath = currentDoc.title + "/" + resultPath >
        <#if theDoc?has_content >
            <#local resultPath = currentDoc.title + "/" + resultPath >
            <#local currentDoc = theDoc >
    <#return resultPath?html >
0 votes

When user of UI try to render this document template with clic on an UI button it fails to get doc.parent with exception user can't read it"… When this document template is rendered by workflow this exception doesn't appear… So, I just add a recovery block to avoiding exception, but it's not the right solution :-(