Member
Member
amucklow   2012-05-30, 14:36
#1
I have a part of my site called 'Archive', which is a page that displays the subalbums of an 'Archive' album. This is my loop:

`
<?php set_context(ZP_INDEX); ?>

<ul class="models">

<?php
while (next_album()):

if ($_zp_current_album->getTitle() == 'Archive') :

$archive_subalbums = $_zp_current_album->getAlbums();

foreach ($archive_subalbums as $arch_sub) :

$subalbumobj = new Album($_zp_gallery, $arch_sub);

// get the data from the first code block
$getcodeblock = $subalbumobj->data['codeblock'];
$codeblock = unserialize($getcodeblock);
//@eval('/>'.$codeblock[$number]);

?>
<li class="grid_6 <?php echo $codeblock[1]; ?>">

<?php $thumbnailobj = $subalbumobj->getAlbumThumbImage(); ?>

[img]<?php echo $thumbnailobj->getCustomImage(null, 230, 154, 230, 154, null, null, [/img]">

<?php if ($codeblock[1] == 'sold' || $subalbumobj->hasTag('sold')) { ?>[img]<?php echo $_zp_themeroot; ?>/images/sold-tab.png[/img]<?php } ?>

<?php echo $subalbumobj->getTitle(); ?>
</li>

<?php endforeach; endif;

endwhile;

?>

</ul>

<?php set_context(ZP_ZENPAGE_PAGE); ?>
`
What's the best way to paginate between pages of these subalbums?

Also, can I set the number of subalbums to display on this page independently of the theme album/image settings?

Thanks
Administrator
Administrator
acrylian   2012-05-30, 15:14
#2
Why don't you just use the normal album page for that? Then you don't need to worry about pagination as that all is already there.

If you need different layouts for certain albums look at the multiple_layouts plugin.
Member
Member
amucklow   2012-05-30, 16:21
#3
Good point. Could have saved myself some time there...

But can you override the number of subalbums to display per page?
Administrator
Administrator
acrylian   2012-05-30, 16:38
#4
You can override most options and so also the album per page one using:
http://www.zenphoto.org/documentation/functions/_functions-basic.php.html#functionsetOption
Look at the database about the actual option name or with the (normally now deleted) setup scripts' `setup-option-defaults.php`
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.