cancel
Showing results for 
Search instead for 
Did you mean: 

list of documents linked to a category in freemarker ftl

omegerard
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to extract a list of documents that are linked to a specific category in freemarker templates. I've been trying a few tricks, but the only things they produced were lots of error lines in the log file.

Now, reading through the template guide, I was fairly convinced that childrenByLuceneSearch was the API to be used. (I'm sure that childrenBySavedSearch will do the job as well, but I don't want to clutter the repository with saved searches.). The only thing is, I can't get it to work. If I do

<#list companyhome.childrenByLuceneSearch(TEXT="3MF") as doc>


or, more specifically,


<#list companyhome.childrenByLuceneSearch(PATH:"/cm:generalclassifiable//cm:D6DocType/MPR/member") as doc>

the Freemarker syntax checker appears to be unhappy. Apprently, maps cannot be "listed". But, what can be done then?

Is there anybody out there who has already played with categories in Freemarker templates?

Regards

Ludo
14 REPLIES 14

omegerard
Champ in-the-making
Champ in-the-making
Hi Andy

Thanks for your comment.

Have you got an rule that is setting categories?
It may also have set category on the folder.

Yes, I have.  Definitely, that rule has linked the folder/space to the category. I had checked it though, but as you pointed out,

Although I think it is not exposed in the UI, folders can be categorised.

The results I obtain suggest that you are right.

Thanks. Seems all confusion has dried up then. The only issue that I think needs to be checked is the numbers in category names/labels.

Regards

Ludo

omegerard
Champ in-the-making
Champ in-the-making
Just one small question on the "member" term.

Can it be used in Freemarker templates like the "child" term?

I'd like to apply the following template

<table>
<#list space.member as doc>
    <tr><td>${doc.name}</td></tr>
</#list>
</table>
onto a category node.  Would that be possible?

Regards

Ludo

kevinr
Star Contributor
Star Contributor
It could do - but we would have to add that to the Templating API.

Thanks,

Kevin

omegerard
Champ in-the-making
Champ in-the-making
Alright then. How do I submit a feature request?

Ludo

kevinr
Star Contributor
Star Contributor