Iterate over the keys of an object. Useful when looking for a particular json key.

Makes the following available to the context of each iteration: $key


   {@iter obj=<object>/}


  • obj - (required) the object whose keys will be iterated over (example: "content.attachments")


This example looks for a node attachment by name. The name is specified in another node property 'attachmentId'

{@queryOne type="myPageType:navigation" }
{@content id="{_doc}"}
<nav id="nav">
    <ul id="navigation">
                {@iter obj=content.attachments}
                {@if cond="\"{$value._doc}\" == \"{attachmentId}\""}
                    <li><a {?linkTarget}target="{linkTarget}"{/linkTarget} href="{$value.url}">{linkTitle}</a></li>
                <li><a {?linkTarget}target="{linkTarget}"{/linkTarget} href="{linkURL}">{linkTitle}</a></li>