Control order of rows

with my query, you can also use CFOUTPUT’s GROUP= parameter, just be a little more crafty in how you print parent versus children

you’ll have to add the COALESCE back into the SELECT clause, alias it as “id”

<CFOUTPUT QUERY="myquery" GROUP="id">
<!--- print parent here --->
<CFOUTPUT>
<CFIF LEN(parent_album)>
<!--- print child here --->
</CFIF>
</CFOUTPUT>
</CFOUTPUT>

With a couple of tweaks, I have a PERFECT display! Can’t ask for much more than that. Thanks rudy and Guido for helping me learn coalesce!

Now my next task is paginating my main gallery page, which is no small task. :slight_smile:

i’m guessing more cleverish code to decide whether to print the <ul> and </ul> tags that go around the children <li> tags

Actually the <ul> stuff was just to help me understand things better. The final version is actually a table in the “CMS” that gives me control over the album. It tells me how many pics are in each album, lets me edit the album details, add new albums, pick a thumbnail as the album avatar, and I can delete an album and either specify a new album for all its pics to move to, or just delete them all.

This all took me around 1/3 the time that it took just to figure out how to incorporate my old PHP gallery into my existing website template.

The tedious part will be FTPing the photos from my old host down to my PC and going through them to delete the crappy ones. My new gallery allows me to either use the CMS (and <cffileupload>) to add pics, or FTP them up and assign them to an album in the CMS.