ZenphotoCMS Forum
Paginate through subalbums on page.php - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Paginate through subalbums on page.php (/thread-10029.html)



Paginate through subalbums on page.php - amucklow - 2012-05-30

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


Paginate through subalbums on page.php - acrylian - 2012-05-30

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.


Paginate through subalbums on page.php - amucklow - 2012-05-30

Good point. Could have saved myself some time there...

But can you override the number of subalbums to display per page?


Paginate through subalbums on page.php - acrylian - 2012-05-30

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`