• Resolved mazoola

    (@mazoola)


    I see half of my question is answered in 1.1.29: The To-Do entry concerning looping through attachments using apr_loop. Is there currently, or do you anticipate there being, any way to nest loops?

    For instance, I have a Virtual Post defined using ‘FIND(‘$1′,genre) > 0’ as its filter. It maps to a page containing a field-less [apr_loop], resulting in a list of all records whose ‘genre’ (a multi-select) contains ‘$1’. For each record, I’d like to be able to loop through its ‘images’ field to display thumbnails for, say, the first 5 images. I’ve not been able to find a way to loop through a field within a record-by-record loop.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chester McLaughlin

    (@chetmac)

    Just pushed out 1.1.30 which fixes nested loops. I haven’t tested with anything other than linked records and attachments yet. And while it should theoretically work for up to 10 nested loops, I haven’t tested it that deep.

    Thanks for the feedback, and let me know how it works for you!

    
    [apr_loop]
      {{Name}}
      [apr_loop1 field="Pictures"]
       {{thumbnails|large|url}}<br>
      [/apr_loop1]
    [/apr_loop]
    
    Thread Starter mazoola

    (@mazoola)

    Thanks! Works great with the couple of test cases I’ve thrown at it so far.

    (Ten deep, eh? This could be fun…)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘nested loops?’ is closed to new replies.