question

Hello,

I have small questions to customize my installation

1. How to add pages to the sites I put the page banniere.php in the directory of my template but how to make the redirection banniere.html?

2. I wish to display the list of my albums in the footer I found this function
`
$_zp_current_album = 2;
while (next_album()): ?>
(…)
endwhile;
`
But how to indicate from what sub albums started? I tried putting the $_zp_current_album variable at the beginning of the function but it does not seem to work?

Thank you for your help

Comments

  • acrylian Administrator, Developer
    1. I don't exactly understand what you want to do. If `banniere.php` should be a static custom page its url on Zenphoto would be `www.example.com/page/banniere/`. There is never a suffix on these pages.

    2. That will not work. `$_zp_current_album` is not a number but an object if in the right context. The `next_album` loop will not work outside of its album/gallery index context and it is dependend on the current page number.
    You better should use the object model if you want to list albums elsewhere like the footer. But note this is already a bit advanced stuff if you are not familiar with coding: http://www.zenphoto.org/news/zenphotos-object-model-framework/

    But I would suggest to read about standard theming for Zenphoto first:
    http://www.zenphoto.org/news/theming-tutorial/

    (Note: I had to edit your code example as it screwed with the forum)
  • 1. yes Exactly what I want to do :)

    2. Thank you I will read all this
  • i test this

    $album_list = new AlbumBase();
    echo $album_list->getAlbums();

    but not :(
  • fretzl Administrator, Developer
    Do you need a list of all albums in the gallery or a list of the sub-albums of the current album?
  • acrylian Administrator, Developer
    mondeduvelo, that of course will not work. If you want all top level albums you need to use the gallery object. That's normally available in the globa `$_zp_gallery`. If you want the direct subalbums of an album you have to create an album object. The object model guide I linked contains examples.
  • @fretzl :

    I want to show in the footer of all pages the name of an album followed by sub albums. Example:

    Album1: sub-album1-1, sub-album1-2, sub-album1-3 ...
    Album2: sub-album2-1, sub-album2-2, sub-album2-3 ...
    ...

    And that whatever page I am in

    @acrylian :
    I created an album object not?
    I tried this too $ album_list = new Album ();
  • acrylian Administrator, Developer
    `I created an album object not?
    I tried this too $ album_list = new Album ();`
    No, you didn't as you didn't set any album name to create an object of. The examples on the link I posted actually describe that. I suggest to get a bit into PHP object basics first before trying this further. It's sadly out of scope of this forum to do so.

    But if you just want a list with linked names I suggest to use the print_album_menu plugin instead. Its function `printAlbumMenu()` would do right away what you want. Please pay atention to the parameters to set. http://www.zenphoto.org/documentation/plugins/_zp-extensions---print_album_menu.php.html#functionprintAlbumMenu
Sign In or Register to comment.