printAlbumMenu() "omit-top" param does not render

When I use the "omit-top" parameter from the printAlbumMenu() function it renders the list on the album pages but not on any other pages..

I just tested it with the Garland theme, in sidebar.php, line 94 changed
`printAlbumMenu("list","count","album_menu","menu","menu_sub","menu_sub_active", $gallery);`
to
`printAlbumMenu("omit-top","count","album_menu","menu","menu_sub","menu_sub_active", $gallery);`
and for example on the news page the list will not render.

Any quick fix for that?

Comments

  • acrylian Administrator, Developer
    Don't use "omit-top" as that as the name says, omits the toplevel. It is context sensitive so if you are on the news page nothing is shown as intendend. This option is intended to be use if you are already within sublevels. For example if you use a separate horizontal menu for the top levels or else and want only to show the sublevels of the currently selected album.
  • OK, I sloved it like this:

    `
    <?php
    // only on the "albums" pages
    if ($_zp_gallery_page == 'album.php') {
    ?>

    <?php printAlbumMenuList("omit-top", true, "", "menu-active", "submenu", "menu-active", "", 2, 0, false, true, NULL); ?>

    <?php
    }
    // if on any other page than "albums"
    else {
    $galleryobject = new Gallery();
    $albumobject = new Album($galleryobject, "albums"); // omit top album "albums"
    $albumarray = $albumobject->getAlbums();

    echo "
      \n"; // top level list
      printAlbumMenuListAlbum($albumarray, "/" . getCurrentTheme() . "/", "", "list", NULL, NULL, NULL, NULL, NULL, NULL, NULL);
      echo "
    \n";
    }
    ?>
    `
  • acrylian Administrator, Developer
    Yep, I would have done it the same way.
Sign In or Register to comment.