Member
Member
rreimche   2013-08-24, 21:19
#1

Hallo again.

I have a "Root" Album and "Subalbum1", "Subalbum2" and "Subalbum3". The 3 subalbums are all children of the "Root".

I am creating a custom page, which can be accessed at "mysite.com/pages/gallery". This page must display contents of the subalbums.

I am stuck at how do I create source for while( next_album() ){}. As far as I see, the next_album() must use some variable that is being created during (pre)processing of a template (index.php, album.php, etc) but I create a custom page and so the question of where to get the stuff is for me open.

Member
Member
rreimche   2013-08-24, 21:26
#2

well, actually the structure has just become a little more complex:

Root
Category1
Subalbum1
Subalbum2
Category2
Subalbum3

Subalbums are children of categories.

The page will be accessed either from "mysite.com/pages/gallery" or from "mysite.com/pages/gallery?category=categoryname". The I want to process the $_GET (if provided) and display the subalbums of the chosen category.

This implies for me that I need also to print links to the "subpages" of the categories.

So it seems after all that I need to be able:

  1. To load the root album and make source for while(next_album()){} from it. This loop should contain only first-level subalbums, e.g. categories.
  2. The same as 1, but this one should contain all subalbums of all categories, but not the categories.
  3. To load a category album and make source for while(next_album()){} from it. This loop should contain the subalbums of a category.
Administrator
Administrator
acrylian   2013-08-24, 21:47
#3

Probably not what you wish as an answer but it always comes down to the object model:
http://www.zenphoto.org/news/zenphotos-object-model-framework

Member
Member
Papyrus   2013-08-25, 01:43
#4

301 redirect the links you want to the album you are using as a category via .htaccess. You'll have to clarify if you need something else.

Administrator
Administrator
acrylian   2013-08-25, 07:19
#5

If I understand it correctly the "category" is just a subalbum. All else would be really unnecessarily complicated.

I even think there is no custom page needed. The better way would be to use the multiple_layouts plugin and create a specific album layout page for different displays.

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