Hi there,
I have created a custom theme based on the zenpage default theme and have combined album.php and image.php to have the images load in the same page as the thumbnails (album.php file). I am now trying to get next and previous buttons so that viewers can click through the images easily but am having trouble getting it to work. I pulled this code from image.php:
<div class="imgnav">
<?php if (hasPrevImage()) { ?>
<div class="imgprevious">
" title="<?php echo gettext("Previous Image"); ?>">« <?php echo gettext("prev"); ?></div>
<?php } if (hasNextImage()) { ?>
<div class="imgnext">
" title="<?php echo gettext("Next Image"); ?>"><?php echo gettext("next"); ?> »</div>
<?php } ?>
and plugged it to the album.php page, but it is bringing up nothing. Here is a link to one of the albums on the site in question:
http://heatherwb.com/portfolios/commercial-campaign-editorial/if anyone could offer advice, I would greatly appreciate it! Thanks.
Comments
" title="<?php echo getBareImageTitle();?>"><?php printImageThumb(getBareImageTitle()); ?>
and that part works just fine, as can be seen here:
http://heatherwb.com/portfolios/commercial-campaign-editorial/
I just can't get the next and previous php to work correctly. The if/then in the next and previous php isn't bringing anything up. I have seen the forum posts about adding thumbs to image.php, but since I already did the whole site this way, I guess I was hoping that there were other options that didn't involve redoing what I have already done. If not, I'll just have to go that route, but I'll still keep my fingers crossed for a couple of days. So if anyone out there has a suggestion...
Thanks!
`
<?php $firstimage = $_zp_current_album->getImages(); ?>
">...
`
That's all. This links to image.php and shows the first image.
"><?php while (next_album()): ?>
which did not seem to help. I am using this javascript to bring up the large images:
<script type="text/javascript" language="javascript">
function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('placeholder').src = whichpic.href;
if (whichpic.title) {
document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
} else {
document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
}
return false;
} else {
return true;
}
}
</script>
and this is the relevant code within the page:
<div id="albums">
<?php while (next_album()): ?>
<div class="album">
<div class="thumb">
" title="<?php echo gettext('View album:'); ?> <?php getBareAlbumTitle();?>"><?php printCustomAlbumThumbImage(getBareAlbumTitle(), NULL, 95, 95, 95, 95); ?>
</div>
<div class="albumdesc">
<h3>" title="<?php echo gettext('View album:'); ?> <?php echo getBareAlbumTitle();?>"><?php printAlbumTitle(); ?></h3>
<small><?php printAlbumDate(""); ?></small>
<p><?php echo truncate_string(getAlbumDesc(), 45); ?></p>
</div>
<p style="clear: both; "></p>
</div>
<?php endwhile; ?>
</div>
<div id="images">
<?php while (next_image(false, $firstPageImages)): ?>
<div class="image">
<div class="imagethumb">" title="<?php echo getBareImageTitle();?>"><?php printImageThumb(getBareImageTitle()); ?></div>
</div>
<?php endwhile; ?>
</div>
<div id="bigImage">
<div class="imgnav">
<?php if (hasPrevImage()) { ?>
<div class="imgprevious">" title="<?php echo gettext("Previous Image"); ?>">« <?php echo gettext("prev"); ?></div>
<?php } if (hasNextImage()) { ?>
<div class="imgnext">" title="<?php echo gettext("Next Image"); ?>"><?php echo gettext("next"); ?> »</div>
<?php } ?>
</div>
<img id="placeholder" src="../../images/blank.gif" alt="" />
<p id="desc">Choose an image to begin</p>
</div>
I hate to be a pest, but the person I made the site for has suddenly decided that having this functionality is the most important thing on the site. Things I wish I had known to start with... Thanks so much for your help!
It is possible to do that your way but you will have to write your own php/js function stuff to get the next/prev buttons working.