The Repeat Template

Mark Birbeck's picture

The template is created from any tags that are inside the repeat element itself, and can include any HTML and XForms tags, including the repeat element. A moment ago we set the template to a simple ellipsis:

      <xf:repeat nodeset="instance('inst-rs')/photos/photo">
        [...]
      </xf:repeat>

This will give us enough to test with, so save and refresh the form, and try searching for something--you should see as many ellipses as there are search results:

Screenshot of Flickr search form showing search results...but only the image titles

Now that we know that both the search and our repeat are working fine, let's fill out the repeat template.

We'll first use a simple output control to show the title of each of the photos returned from Flickr, before we then move on to show how to display the actual image.