How to split horizontal looper?

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

How to split horizontal looper?

Post by antonio » 2012-09-14 17:27

Hi all,
I created a complex recordset that will display results using horizontal looper: 4 columns by X rows.
A sort of thumbnails gallery where all images area sorted by category.

But with HL all images area one after the other.

Example:

Code: Select all

(cat1)thumb1 - (cat1)thumb2 -  - (cat1)thumb3 - (cat1)thumb4 - 
(cat1)thumb5 - (cat2)thumb6 - (cat2)thumb7 - (cat2)thumb8
I would like to "split" the thumbnail gallery when the category changes and get something similar:

Code: Select all

(cat1)
thumb1 - thumb2 -  thumb3 - thumb4 - 
thumb5

(cat2)
thumb6 - thumb7 - thumb8
Is this possible with ADDT?

I already tried to use the "show if changed" behaviour but I can't get anything similar to my example.

Any suggestion will be appreciated, Fred ;)
tony

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

Re: How to split horizontal looper?

Post by Fred » 2012-09-15 13:15

I don't know if ADDT has a "Nested repeat region" so think outside the box if it doesn't... ;)
  • 1. Create a recordset with your categories and display a normal looper. Make sure to include the category id (cat_id) in the recordset as well. You will need it for the next step.

    2. Now create a recordset for the images and filter them by the cat_id
    The trick is to have the sql execute inside the loop and not where you would usually expect the query to be executed.
    So you end up with the query being rewritten with the new cat_id each time the now row is listed

    3. Create another looper inside the first one.
You will need a bit of hand coding for this to work.

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

Re: How to split horizontal looper?

Post by antonio » 2012-09-17 17:06

Hi Fred,
thanks for your insight.
In fact, I just discovered that ADDT has a Nested repeat region behaviour.

I had to tweak it a bit to make it work with my page.

Testing it now.

Out of curiosity: Fred, since ADDT is not supported any more and php 5.3 or 6.0 is near, what do you would use to replace ADDT? is there a good RAD fo php?

In any case, I count on this forum since it is my last resort for trouble shooting my problems.
Your help is invaluable, Fred. Let me know when you came in Italy ;)

Tony

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

Re: How to split horizontal looper?

Post by Fred » 2012-09-17 19:14

Tony,
Glad you got it sorted.
This here should help you with php5.3.x
http://www.interaktonline.info/article/ ... P-5.3.html

http://www.interaktonline.info/files/47 ... patch.html

I dont use ADDT so cant say if it is working 100%. There is no comments on this so I assume it is.

Would love to come to Italy some day. Where abouts are you located?

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

Re: How to split horizontal looper?

Post by antonio » 2012-09-19 08:22

Would love to come to Italy some day. Where abouts are you located?
Hi Fred,
I live on the Como lake, near Milan.

Ciao ;)

tony

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

Re: How to split horizontal looper?

Post by Fred » 2012-09-19 10:41

It is beautiful out there. I might surprise you one day.

Post Reply