Nested repeat on a recordset?

Any tips and tricks that has to with the ADDT that doesn't fit into one of the other categories
antonio
Posts: 77
Joined: 2010-09-28 11:48

Nested repeat on a recordset?

Post by antonio » 2014-08-01 15:13

Hi all,
I have a recordset that outputs the following table:

Code: Select all

id          image          code
1          image1          uy6754
2          image1          uy4795
3          image1          uy1234
4          image2          uh7364
5          image2          ah6775
6          image2          lo9834
7          image3          iu7654
8          image3          jh4321
9          image3          po0989
...
I would like to get this:

Code: Select all

image          code
image1         uy6754
               uy4795
               uy1234
image2         uh7364
               ah6775
               lo9834
image3         iu7654
               jh4321
               po0989
...
Important: the image is 100px height and I would like the codes to floats to the right of the image. And if there are too many codes they should be left aligned to the first code. But I think to solve this with CSS.
If I apply the "show if field is changed" conditional behavior on the image field I get almost what I need but I'll get only one code aligned to the right of the related image. All other codes fall down just below the image and I get too much space from the first code and the next one.
Hope you get an idea with the followin example.

Example:

Code: Select all

[b]image          code[/b]
+---------+
+         +
+ image1  +     uy6754
+         +         
+---------+         
                uy4795
                uy1234
image2          uh7364
                ah6775
                lo9834
image3          iu7654
                jh4321
                po0989
...
I just tried the nested repeat wizard but it requires two table and the only think I can provide is a recordset.
How can I crete this simple scenario?

TIA

tony

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: Nested repeat on a recordset?

Post by Fred » 2014-08-06 10:37

Tony,
I have done something similar to what you want and eventually ended up handcoding it.
Create a normal repeat region with the images and within the table add a sql query that will query the codes "SELECT code WHERE image = $image"
$image is the name of the image in your original repeat region.

Then simply add a repeat region where you need it.

Make sense?

macJack
Posts: 14
Joined: 2012-06-14 12:26

Re: Nested repeat on a recordset?

Post by macJack » 2014-08-29 10:33

You may also use this extension. I have used it before and it works fine http://www.tom-muck.com/extensions/help ... tedregion/

antonio
Posts: 77
Joined: 2010-09-28 11:48

Re: Nested repeat on a recordset?

Post by antonio » 2014-08-29 10:42

Thanks to you all!
it's good to see someone else working with ADDT or MX Kollection. :D
tony

Post Reply