Member
Member
br4inwash3r   2007-10-30, 13:18
#1
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?
Member
Member
sbillard   2007-10-30, 21:43
#2
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.
Member
Member
BertSimons   2007-11-01, 12:07
#3
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
Member
Member
BertSimons   2007-11-01, 19:51
#4
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..
Administrator
Administrator
acrylian   2007-11-02, 10:20
#5
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="album">

div class="thumb">

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

<div>

div class="albumdesc">

"><?php printAlbumTitle(); ?>

<small><?php printAlbumDate(""); ?></small>

<?php printAlbumDesc(); ?>



<p style="clear: both; ">

</div>

<?php endwhile; ?>

</div>`

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 = <yourspecialstyle>; } ?>`

Then put the `<div class="album">` 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.
Member
Member
BertSimons   2007-11-02, 13:41
#6
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..
Administrator
Administrator
acrylian   2007-11-02, 14:33
#7
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.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.