ZenphotoCMS Forum
Creating a custom page for albums -- how to process the desired subalbums? - 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: Creating a custom page for albums -- how to process the desired subalbums? (/thread-11297.html)



Creating a custom page for albums -- how to process the desired subalbums? - rreimche - 2013-08-24

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.




Creating a custom page for albums -- how to process the desired subalbums? - rreimche - 2013-08-24

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.



Creating a custom page for albums -- how to process the desired subalbums? - acrylian - 2013-08-24

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




Creating a custom page for albums -- how to process the desired subalbums? - Papyrus - 2013-08-25

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.




Creating a custom page for albums -- how to process the desired subalbums? - acrylian - 2013-08-25

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.