AnsweredAssumed Answered

Find documents whose title contains specific String

Question asked by huijzer on Feb 16, 2007
Latest reply on Feb 17, 2007 by huijzer
Hi,

I am writing a Freemarker template that will show all documents whose title contains a specific string, for instance 'xyz'.

I tried several things, but have not had any succes. My current code is:


<table cellpadding="3">

    <tr>
        <th align="left">Name</th>
        <th align="left">Title</th>
        <th align="left">Size</th>
        <th align="left">Display Path</th>
    </tr>

    <#list companyhome.childrenByXPath[".//*[contains('xyz')]"] as child>
        <#if child.isDocument>
            <tr>
                <td>${child.properties.name}</td>
                <td>${child.properties.title}</td>
                <td>${child.size} bytes</td>
                <td>${child.displayPath}</td>
            </tr>
        </#if>
    </#list>

</table>

This not only returns documents with 'xyz' in the title, but also with that string in it's name or contents.

Does anyone know how to retrieve only documents with 'xyz' in its title in a Freemarker template?

Thanks in advance,

Arjan Huijzer

Outcomes