Page 1 of 1

How to split horizontal looper?

Posted: 2012-09-14 17:27
by antonio
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

Re: How to split horizontal looper?

Posted: 2012-09-15 13:15
by Fred
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.

Re: How to split horizontal looper?

Posted: 2012-09-17 17:06
by antonio
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

Re: How to split horizontal looper?

Posted: 2012-09-17 19:14
by Fred
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?

Re: How to split horizontal looper?

Posted: 2012-09-19 08:22
by antonio
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

Re: How to split horizontal looper?

Posted: 2012-09-19 10:41
by Fred
It is beautiful out there. I might surprise you one day.