![]() |
|
Navigating Sub-albums - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Navigating Sub-albums (/thread-11435.html) |
Navigating Sub-albums - gcortes - 2013-10-26 How does one navigate sub-albums programmatically? If I call getAlums on a gallery, it only gives me the high level albums. I called getNumAlbums() on an album that had sub albums and got the count of the albums. The getNext and getPrev functions only return albums at the same level. What do I call to get a sub album object? Navigating Sub-albums - acrylian - 2013-10-26 Using the object model framework: Navigating Sub-albums - gcortes - 2013-10-26 There's nothing on that page about accessing sub albums. Is there a method on a class in your framework that returns a pointer to a sub-allbum? I've looked through Album and AlbumBase can't find a method that does so. Here's the code I have so far $gallery = new Gallery(); The method getAlbums returns the names of the sub albums. The method getNumAlbums returns the number of the sub albums. I need a pointer to the sub album object. There's a method getParent that would presumably get me the parent of a sub album so there must be a way to get to the child. Navigating Sub-albums - gcortes - 2013-10-26 I found this in the framework doc: If you want to create an object of a subalbum the name must include the parent album name(s) like "toplalbumfoldername/subalbum1folder/subalbum2folder" (etc); This would work if I was willing to hard code the name of one of the sub albums. I want the code to be dynamic in that it would process any sub album it found if any. Navigating Sub-albums - gcortes - 2013-10-26 OK, I think I have it figured out. You call getAlbums to get the names and then do a new on each. Navigating Sub-albums - acrylian - 2013-10-26 Yes, that's it, best recursively so you get all levels exisiting. |