Change of album.php for a specific album

Hi everyone,
I need to slightly change the album.php page for a specific album (to add the description of the present image.)
I know that a theme can be affected to this album, but as this theme is barely the same as the current theme, it seems a bit heavy to duplicate it, just for a tiny modification. (Later improvements of the theme will have to be done twice etc ... boring.)
I haven't found in zp any equivalent of the child theme feature (wordpress) so I wonder if there is a more elegant way to get the job done.

Thank's for any advice !

Comments

  • acrylian Administrator, Developer
    The next version (or the nightly if you want to try) will contain a plugin named "mutliple_layouts" that will allow to assign special layout theme pages to all main itlems (as there are images, albums, Zenpage pages, news articles and categories)

    Meanwhile you will have to do this using the object model directly (see the tutorial for that and if you haven't already the theming tutorial as well). Check for the album name with a if/else or a switch() clause and then do your special stuff.
  • Thanks Acrylian,
    Well, I'm going to wait for the next version. The plugin you mention sounds great ...
    (which one by the way ? ... in one month ? in six ? ... when should it be expected approximately ?)

    ... but as I'm writing these words I think "try to do the php trick yourself ... don't be such a lazy slug ..."
    Being a little less stupid every day is good.
    Well, let's go. Testing the name of the current album does not sound too difficult.
    But testing if it is contained by an album named "shop" for example ... I don't know which function I could use ...
    Any clue ?
    Thanks and bye ...
  • http://www.zenphoto.org/trac/roadmap

    (Of course, this is only a projection.)
  • Not exactly sure what test you are asking. But here is a guess:

    `
    $foldernames = explode('/',$_zp_current_album->name);
    if (array_search('shop',$foldernames) !== false)) {there is 'shop' somewhere in the album name;}
    `
  • Thanks,
    Waou ! ... 1.4.0 is near !
    ...
    in the mean time, I found :
    `
    <?php
    $url = $_zp_current_album->getAlbumLink( );
    $pos = strpos($url, "shop");
    if ($pos)
    {
    ?>
    *you're in shop*
    <?php
    }
    ?>
    `
    ... which proves that even a total zero in php can move its little ass and find a solution ... (by the way it seems to work ...)

    As you guess I don't do this to display *you're in shop* ...
    but instead, the description of the current image (we are in album.php)

    The next code (from image.php) does not work in album.php :
    `
    <?php printImageDesc( true,'','') ; ?>
    `
    ... and here ... I have no clue ...
    Thanks !!
  • `printImageDesc()` is only valid when there is an image context setup. Like in the `next_image()` loop or on the image page. I would guess that you have no image at the time you called it. It would depend on where you made the call.
  • BTW, your other code has a lurking flaw. If "shop" happens to start the album name your if ($pos) will not succeed. You need if ($pos != false) to be sure. One of those strange things about PHP that you just have to get used to. The value zero is also `false`.
  • Thanks for the `!= false` stuff.

    For the `printImageDesc()` , I use it with the zpgalleriffic theme, in between the image and the thumbs.
    Do you know if there is a way to make the image display be identified as a "current image" ?

    I guess it's a specific zpgalleriffic problem ... isn't it ?

    Suddently I get pessimistic ... :o( ....
  • I'm not familiar with that theme at all. If you know the image you want, look for the "makeimagecurrent" function. (or something like that, don't have the source handy at the moment)

    Otherwise, maybe the theme author will step in and help.
  • Ok ...
    Thanks for for your constantly excellent support ...
Sign In or Register to comment.