![]() |
|
Loop through Parent-Album on Sub-Album Page - 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: Loop through Parent-Album on Sub-Album Page (/thread-8895.html) |
Loop through Parent-Album on Sub-Album Page - zubizuri - 22-07-2011 Hey guys, I was wondering how to create a loop through the Parent-Album (UrAlbum) when i am viewing a sub-album page. currently my loop looks like: Is there any way to tell the loop function to check the parent album instead of the current sub-album? Loop through Parent-Album on Sub-Album Page - acrylian - 22-07-2011 No, you have to use the object model. See the tutorial and the functions documenation. Btw, the parent album is not necessarily the uralbum. The latter refers to the top level parent. Loop through Parent-Album on Sub-Album Page - zubizuri - 22-07-2011 Well in my case the parent album is also the top level parent. I already used: $uralbumobj = getUrAlbum($_zp_current_album); To Show Custom Album Fields from my UrAlbum. Is there no simple way to connect the loop the the "$uralbumobj" Object as well? Loop through Parent-Album on Sub-Album Page - acrylian - 22-07-2011 You could set the uralbum object to the current album object. But that might of course confuse other parts of your site. Then you should use the object model directly. Loop through Parent-Album on Sub-Album Page - zubizuri - 29-07-2011 For those who are searching the forum for the same question, this is how i did it: Make a copy of the "next_image" function, name it "nextUr_image". Put this function into the template "functions.php", add this line on top : ` while (nextUr_image()): ` And you will have a query through your Top-Level Parent Album, while you're on a sub-album page. Loop through Parent-Album on Sub-Album Page - zubizuri - 29-07-2011 btw. thanks for your support acrylian. Loop through Parent-Album on Sub-Album Page - acrylian - 29-07-2011 You are welcome. You could have used the object model directly as well. |