Member
Member
tosca   2013-08-20, 07:56
#1

I'm using the printAlbumMenuListAlbum in order to print an albums menu on each page of the gallery.

I don't want it be context sensitive (visitors should have access to the whole gallery from anywhere they are) but I would like to restrict it to one branch of the albums folder. That's because I've separated:

  • pictures that are 'real' photographies and will be displayed in the gallery part
  • anything else (specific albums, that is) that could be used in Zenpages pages.

I've searched for some kind of parameter to instruct printAlbumMenuListAlbum to begin for a special 'node' of the albums tree, but didn't find anything; it's either the whole gallery (= all the albums) or context sensitive.

Could you give me some advice on the matter?
Thanks.

Administrator
Administrator
acrylian   2013-08-20, 10:25
#2

I am not sure I understood. There is an option to display only the sub albums for an album and omit the top level. So if you have two top level albums "album1" and "album2" it would just display the sub level of those if within those albums and their childs.
http://www.zenphoto.org/documentation/plugins/_zp-extensions---print_album_menu.php.html#functionprintAlbumMenu
"omit-top" or for jus the sublevels of the current album "list-subs".

If you need more specific menus or behaviour you need to either use the menu manager plugin with several menu sets or create a custom function.

Member
Member
tosca   2013-08-20, 13:32
#3

First line of the link you produced says:
"Prints a list of all albums context sensitive." so this won't work as I want to display the same subtree on all the pages of the gallery.

The album element - unless I'm mistaken - only returns a link to a specific album.

What I'm looking for is a combination of both: a whole menu album starting from the one I choose down to the lowest levels.

I think I need to adapt the printAlbumMenu but I don't know how to tell my function where to start from; it's neither the top level, nor the current album. How can I specify the album I want it to start from? id? or name? Which parameter should I need to modify?

Administrator
Administrator
acrylian   2013-08-20, 13:41
#4

If your branches are topl level ones "omit top" does what you want. Within that it folds out context sensitive as usual. Unless you enable it to show all levels always.

This is a quite complicated plugin especially because getting the nested html list correctly done although it "just prints" a list. What you want might be not that easy.

It might be easier to write a simple custom function if you know your album level depth. In any case you need to use/get into the object model and thus always have to use the album name. The id has no role in the object model.

Member
Member
tosca   2013-08-20, 14:28
#5

What I currently have is the whole albums list here: whole list.
What I would like is the non-greyed part only, so it is all the albums downwards from one of the top-level called 'Galerie'.

Administrator
Administrator
acrylian   2013-08-20, 14:39
#6

That is not possible with the album menu plugin. You could try some jQuery magic to hide the other toplevel tree though maybe.

Otherwise you would be better off using the menu manager then.

Member
Member
tosca   2013-08-20, 18:59
#7

Well, thanks for having a look. I'll thing about it.

Member
Member
tosca   2013-08-26, 17:27
#8

Should have thought about it sooner: the solution is to instantiate a new gallery object which root is the highest level album containing my photos, then call the printAlbumMenuListAlbum for this sub-gallery.
Here it is:

`
$myPhotos = new Album($_zp_gallery, 'galerie/');
$albums = $myPhotos->getAlbums();

printAlbumMenuListAlbum($albums, $albumpath, $currentfolder, $option, $showcount, $showsubs, $css_class, $css_class_topactive, $css_class_active,$firstimagelink,$keeptopactive,$limit);
`

Administrator
Administrator
acrylian   2013-08-26, 17:43
#9

Even I haven't thought about that helper function… Btw, you don't instaniate a "gallery object" (means the whole site in ZP terms) but an "album object".

On 1.4.5 you should use the function newAlbum() instead of the class constructor directly.

Member
Member
tosca   2013-08-26, 21:42
#10

Thanks for the advice, I will change that. In fact, I had copied/pasted some code written a few months ago for my home page, and didn't realized 1.4.5 brings new functions in that department.

Administrator
Administrator
acrylian   2013-08-27, 08:32
#11

What you did does work of course, but the new function is a bit saver (there is an equivalent for the image class constructor, too).

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