Hmm, I looked in the themeoptions.php in the zenpage theme and the closest function is createMenuIfNotExists in which you pretty much assign all the parts right there. I need a function like what i was using where it gets the listing of albums and subalbums (or parents) and creates the menus and allows me to style them. Mostly the code I posted does what I need. I just need a way to add the link in here to replace the function that no longer works. (the line that starts createAlbumMenuLink below)
` <?php $parent = $_zp_current_album->getParent(); if (!is_null($parent)) { ?>
<?php
$ParentTitle = $parent->getTitle(); $gallery = $_zp_gallery; $albums = $_zp_gallery->getAlbums(); foreach ($albums as $toplevelalbum) { $topalbum = new Album($gallery,$toplevelalbum,true); if ($ParentTitle == $topalbum->gettitle()) { ?> <?php createAlbumMenuLink($topalbum,$option2,$css_class_topactive,$albumpath,"list"); ?>
Maybe I don't understand. From a quick look you want to create a listing of all albums and highlight the current. That is what the print_album_menu does already (or the menu_manager plugin if you want to use it). It also attaches css classes for styling.
Well, that's mostly right. The top on the menu I want to highlight the menu option they are on and on the submenu I also want to highlight the item they are on. (mmhere is the style in the css for the highlight). When I was first setting this up only the current item was being highlighted so the code above added a highlight where it was missing.
So you are also saying `$ParentTitle = $parent->getTitle();` should be: $ParentTitle = $parent->getname();
and `$ParentTitle == $topalbum->gettitle()` should be`$ParentTitle == $topalbum->getname()`
The print_album_menu does not have css to highlight the parent as well (if I recall right) but the menu_manager plugin generated menu for sure does have that (classes like "active-1" or "active" are assigned). Best take a look at the generated source code before you code what is already there (you can certainly have several menu sets).
Yes, the title is not a fixed term and independend from the name. In multilingual mode it can even be different for each language.
OK, to be clear, I have a site top level menu that is always there.
In you go into a gallery menu then you see the top level galleries menu
If you go into the subalbums then you should still see the gallery menu and the subs for the selected gallery
Well, I tried replacing the previous code with ` <?php printAlbumMenuList("list",'','','mmhere','','mmhere',"",'','',true,true,''); ?> ` which has the odd behavior of displaying the active choice of the top menu and any items before it above the sub menu (when you move to one) but the rest of the menu below the sub menu such as Site top level meunu Gallery 1, Gallery2 etc.
Move to Gallery 1 you get
Gallery 1 Sub 1, Sub2, etc. Gallery2, Galery 3, etc.
I'm going to leave it line the for a little in hopes you'll take a quick look (only the fine art gallery at http://DennSantoroPhoto.com
So it is partly waht I want (although it is getting a much longer string than it used to get so I guess you changed what value it picks up from what it used to.
Closer. Not there yet. Thanks for all your help so far though!
I did find such a function in the print_album_menu plugin of v1.2.2. Here is the comment block of the function: ` /** * A printAlbumMenu() helper function for the list menu mode of printAlbumMenu() that only * generates an list item, as a link if not the current album * Not for standalone use. * * @param object $album the album oject * @param string $option2 the value of $option of the printAlbumMenu() * @param string $css One of the both css_active values of the printAlbumMenu() * @param string $albumpath the albumpath for mod_rewrite or not * @param string $mode "list" for list mode link, "jump" for jump mode link * @param int $level level number for jump mode (0 toplevel, 1-4 sublevel) * @return string */ ` Note especially the line " * Not for standalone use."
What I see on the site is possible with the menu_manager which is also the tool to use to create a combined gallery/pages/whatever menu. Since it creates a nested html list for semantic (meaning the submenu should be sub list of the main one and not separate as on your site) and validation the whole menu is possible but of course will require some css work to get the same look.
The album menu is really only for albums. I agree that the toplevel should probably get a css class for styling as well. So please open a ticket for that (probably the other standalone menus should get that as well).
Hey all, thanks for the help. I don't know if you saw the borked version where the sub galleries ended up in a row (horizontal list) in between the top level gallery menu or nbot. But I took that level off after a couple of hours. I have decided just to go wth the top level menu for the site (which does not change) and the gallery level menu, with no sub menus as that works fine and I can deal with it in a very straight forward way. So now the submenu for the galleries is just generated inside the submenu div (all the other non-gallery submenus also live in a submenu div with a css style so the gallery ones pick it up too) as:
`
` The site designer thinks it looks fine (although she thinks we'll need to tweak the css to get the same padding on the highligh for the active)
Comments
`
<?php $parent = $_zp_current_album->getParent();
if (!is_null($parent)) { ?>
<?php
<?php$ParentTitle = $parent->getTitle();
$gallery = $_zp_gallery;
$albums = $_zp_gallery->getAlbums();
foreach ($albums as $toplevelalbum) {
$topalbum = new Album($gallery,$toplevelalbum,true);
if ($ParentTitle == $topalbum->gettitle()) { ?>
<?php createAlbumMenuLink($topalbum,$option2,$css_class_topactive,$albumpath,"list"); ?>
<?php } else {
createAlbumMenuLink($topalbum,$option2,$css_class_topactive,$albumpath,"list");?> <?php }}
?>
/*printAlbumMenuList("list-sub",'','','mmhere','',"mmhere","", false);*/}
else {
printAlbumMenuList("list-top",'','','mmhere','',"","", false);
}
?>
`
You can easily create a "album link" by, well, creating a link `getAlbumLinkURL(); ?>">`.
Btw, NEVER check the album title, check the album name as that is the value to identify (see the object model tutorial).
So you are also saying `$ParentTitle = $parent->getTitle();`
should be: $ParentTitle = $parent->getname();
and
`$ParentTitle == $topalbum->gettitle()`
should be`$ParentTitle == $topalbum->getname()`
I'll look for the tutorial.
Yes, the title is not a fixed term and independend from the name. In multilingual mode it can even be different for each language.
In you go into a gallery menu then you see the top level galleries menu
If you go into the subalbums then you should still see the gallery menu and the subs for the selected gallery
Well, I tried replacing the previous code with
`
<?php printAlbumMenuList("list",'','','mmhere','','mmhere',"",'','',true,true,'');
?>
`
which has the odd behavior of displaying the active choice of the top menu and any items before it above the sub menu (when you move to one) but the rest of the menu below the sub menu such as
Site top level meunu
Gallery 1, Gallery2 etc.
Move to Gallery 1 you get
Gallery 1
Sub 1, Sub2, etc.
Gallery2, Galery 3, etc.
I'm going to leave it line the for a little in hopes you'll take a quick look (only the fine art gallery at http://DennSantoroPhoto.com
So it is partly waht I want (although it is getting a much longer string than it used to get so I guess you changed what value it picks up from what it used to.
Closer. Not there yet. Thanks for all your help so far though!
`
/**
* A printAlbumMenu() helper function for the list menu mode of printAlbumMenu() that only
* generates an list item, as a link if not the current album
* Not for standalone use.
*
* @param object $album the album oject
* @param string $option2 the value of $option of the printAlbumMenu()
* @param string $css One of the both css_active values of the printAlbumMenu()
* @param string $albumpath the albumpath for mod_rewrite or not
* @param string $mode "list" for list mode link, "jump" for jump mode link
* @param int $level level number for jump mode (0 toplevel, 1-4 sublevel)
* @return string
*/
`
Note especially the line " * Not for standalone use."
The album menu is really only for albums. I agree that the toplevel should probably get a css class for styling as well. So please open a ticket for that (probably the other standalone menus should get that as well).
`
`
The site designer thinks it looks fine (although she thinks we'll need to tweak the css to get the same padding on the highligh for the active)
Thanks much for all the help.