PageTranslations Example

In this example, a recursive listing of all subfolders in the filesystem of the site is achieved using a macro in a PageTranslation.

Smartsite SXML CopyCode image Copy Code
<se:pagetranslations id="dir">
    <se:collection>
        <se:member name="recurse">
            <se:dir path="{translation.arg(1, default='/')}">
                <se:parameters>
                    <se:parameter name="rowformat" trim="both">
                        <li><a href="{this.field(location)}">{this.field(location)}</a><br/>
                        {translation.dir.recurse(this.field(location))}
                        </li>
                    </se:parameter>
                    <se:parameter name="resultformat"><ul>{this.result()}</ul></se:parameter>
                </se:parameters>
            </se:dir>
        </se:member>
    </se:collection>
</se:pagetranslations>

{translation.dir.recurse('')}