Gallery Children Category Question
Posted: 29 September 2007 12:32 AM   [ Ignore ]  
Summer Student
Total Posts:  18
Joined  08-07-2007

Hi All,

This may be a silly question, but I’m pretty new to ee and it’s late and I’m stumped.  I have a gallery with many images uploaded.  Within the one gallery, I have several categories which each have several children categories:

Parent 1
    Child 1
    Child 2
    Child 3
    Child 4
Parent 2
    Child 1
    Child 2
    You get the idea

What I’d like to do is call all the images from a single Parent category but then paginate by Child categories (some children have 1 image some have 10).

Perhaps it’d be more possible if I (or you if you’re being wonderful and helping me out on this) think of it as getting all the images from a single child and then having a link at the bottom that goes to the next child - so all images/captions/etc from Child 1 would be called and then at the bottom it would say something like “Child 2—>” and be a link to Child 2.

Not quite the same effect as paginating, but this might actually wind up being more user friendly. At this point, I’ll take what I can get. So if you know how I can do either of these things, please tell me and thank you thank you thank you!

~D

Profile
 
 
Posted: 30 September 2007 09:32 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23538
Joined  05-20-2002

In truth, I can’t think of a good way to do it.  You could try tweaking on this- basically if someone gets it working, you’d need to add some php to dynamically pull out the current cat id from the url- which is easy enough.  But for now, I’d work with it hard coded.

{exp:query sql="SELECT g1.cat_id, g1.cat_name FROM exp_gallery_categories g1, exp_gallery_categories g2 WHERE g2 cat_id =  x AND g1.parent_id = g2.parent_id ORDER BY g1.cat_order"}
{cat_name}
-
{/exp:query}


For now, replace ‘x’ with the cat id number of the current page you’re testing on.  What it should do is pull out all of the cats that have the same parent as the current cat.  Which gets you about halfway there- and obviously isn’t going to work on the main cat pages.  You’d want something different there.

But the glitch for me is figuring the offset.  Hm- wonder if you do a > cat_order and a limit one?  Not sure- but this is where I’d start.  Maybe fresh eyes can add onto it.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65027 Total Logged-in Users: 40
Total Topics: 82116 Total Anonymous Users: 19
Total Replies: 441312 Total Guests: 193
Total Posts: 523428    
Members ( View Memberlist )