Customize Album View

Hi guys, i need some help customizing the index page of my gallery. I have a special album that I'd like to separate from the others.

The layout I'm after is looking something like this.

Can zenphoto do stuff like that?

Comments

  • I am sure there is a way to do that. The theme "Stopdesign" does something similar. It puts most recent albums on the main page, then has a link to all the albums. You might take a look at that theme. Be sure you get the version from the community build as it has been totally rewritten from the original on trak.
  • I actually just did this two days ago for a site I am working on.

    see it here: http://www.thegreenskirt.nl/site/projects

    his is how I did it:
    add a folder to zp_themeroot named albumstyles eg: "themename"/albumstyles
    in the folder albumstyles put different css.files for the different album "appearances".
    eg "themename"/albumstyles/sergio.css, sergio.css now containing only css to be different then the zen.css like backgroundcolor, different header-images etc.

    (load the custom functions by putting <?php require_once ('customfunctions.php'); ?>
    as first line in your album/image.php) Put this in the customfunctions.php;

    <?php
    function printPerAlbumStyle() {
    global $_zp_themeroot;
    $css = getAlbumPlace();
    $searchpath = str_replace (WEBPATH, '', SERVERPATH);
    if (file_exists($searchpath . $_zp_themeroot.'/albumstyles/'.$css.'.css')) {
    echo '<link rel="stylesheet" href="'.$_zp_themeroot.'/albumstyles/'.$css.'.css" type="text/css" />';
    } else { return;
    }
    }

    and then put <?php printPerAlbumStyle(); ?> in the top of the album/image.php
    right under the head containing "<link rel="stylesheet" href="<?php echo $_zp_themeroot ?>/zen.css" type="text/css" />"

    if you now fill in a name like "sergio" in your album field 'location' (or 'place') it wil call the function
    printPerAlbumStyle to write a new link to the "sergio.css" in you album/image page.
    the only thing that has to be done is make an extra datafield in the admin section like "albumstyle" so I do'nt have to use the location field.. But I don't now how to do this without hacking the core files.

    .Example on:http://www.thegreenskirt.nl/site/projects
  • hmm I actually want to do this in a simpler way..

    I tried making the css a php by adding <?php header("Content-type: text/css"); ?> at the top of the zen.css and saving it as zen.php and then in the album load the stylesheet zen.php instead of zen.css. No problem..

    but.. I am not able to put functions in this zen.php .. how should I proceed? I tried to include the template functions in the zen.php with an include call e.g but without succes..
  • acrylian Administrator, Developer
    If I get you right, you want the first album look different as the others?
    I have not tested it, but why don't you use the album loop on index.php:
    `


    <?php while (next_album()): ?>



    div class="thumb">

    a href="<?php echo getAlbumLinkURL();?>" title="View album: <?php echo getAlbumTitle();?>"><?php printAlbumThumbImage(getAlbumTitle()); ?>



    div class="albumdesc">

    " title="View album: <?php echo getAlbumTitle();?>"><?php printAlbumTitle(); ?>

    <?php printAlbumDate(""); ?>

    <?php printAlbumDesc(); ?>





    <?php endwhile; ?>

    `

    If you say want the first album on top of the page different, sort it in the admin and then check the album name right in the loop with a simple:
    `<?php if(getAlbumTitle() === <youralbumname>){ $css = ; } ?>`

    Then put the `
    ` in an echo statement like this
    `<?php echo "<div class="".$css."">"; ?>` and it will look different. Of course this is only for the css styles, but you could use an if statement for an different albumthumbsize, too.
  • thanks but..no..I want to have a different look for each album inside the albums..just as I managed to do in my previous way and as you can see at http://www.thegreenskirt.nl/site/projects as you can see if you open the first three albums they all look different.

    however your reply,using the albumtitle can give a simple solution too.

    at the top of album php just under

    <link rel="stylesheet" href="<?php echo $_zp_themeroot ?>/zen.css" type="text/css" />"

    i just put;

    <?php
    $css = getAlbumtitle();
    echo '<link rel="stylesheet" href="'.$_zp_themeroot.'/albumstyles/'.$css.'.css" type="text/css" />';
    ?>

    make a folder albumstyles in the theme directory and in this put different css files for each album.

    backdraft of this solution however:
    I must make sure the css files have exact the same name as the album titles..
  • acrylian Administrator, Developer
    Sorry, I did ideed get you wrong. Must have been because the thread starter br4inwash3r spoke of the index page..

    Then your way is of course the right one.
Sign In or Register to comment.