Member
Member
zubizuri   22-07-2011, 14:47
#1

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?

Administrator
Administrator
acrylian   22-07-2011, 15:00
#2

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.

Member
Member
zubizuri   22-07-2011, 15:07
#3

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?

Administrator
Administrator
acrylian   22-07-2011, 15:23
#4

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.

Member
Member
zubizuri   29-07-2011, 08:44
#5

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 :
$_zp_parent_album = getUrAlbum($_zp_current_album);
and replaced all "$_zp_current_album" in the function with "$_zp_parent_album". Now you can write your loop on the album.php page like this:

`

while (nextUr_image()):

`

And you will have a query through your Top-Level Parent Album, while you're on a sub-album page.

Member
Member
zubizuri   29-07-2011, 08:58
#6

btw. thanks for your support acrylian.

Administrator
Administrator
acrylian   29-07-2011, 09:01
#7

You are welcome. You could have used the object model directly as well.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.