Forum
Album listing order
I have a list of albums on my gallery page. I would like to switch the order (so that the most recent is first) - ie sort by album date.
Please can you tell me what the album date id is so I can add it to the SORT.
Thanks
On my gallery/index.php i have :
<div class="box gallery upcoming">
<h2>List of Albums</h2>
<ul class="glist albums">
<?php perch_gallery_albums(array(
'template' => 'list_of_albums.html',
)); ?>
</ul> </div><!--end box-->
In my list_of_albums.html template I have :
<li class="event">
<a href="album.php?s=<perch:gallery id="albumSlug" />"><perch:gallery id="albumTitle" /></a>
</li>
Can you show us your album template?
This is my album.html template :
<?php include('../../perch/runtime.php'); ?>
<!DOCTYPE html> <html lang="en">
<head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content="">
</head>
<body> <script type="text/javascript"> $(document).ready(function() { $(".fancybox").fancybox(); }); </script> <div class="container masthead"> <img src="../../images-cfpc/pony-club-masthead.png" class="img-responsive" alt=""> </div> <?php require_once('cfpc-menu.php'); ?>
<ul> <?php if(perch_get('s')) { perch_gallery_album_images(perch_get('s'), array( 'template'=>'album-image.html')) ; } ?> </ul> <div style="clear: both;"></div>
<footer> <?php require_once('../../includes/footer.php'); ?> </footer>
</body>
</html>
I think that's your page rather than the
album.html
template.Ok. What's the ID of the date field you want to sort by?
whoops I think you wanted this <h1 class="text-center welcome"><perch:gallery id="albumTitle" type="text" label="Title" size="l" /></h1>
<span class="text-center welcome"><perch:gallery id="description" type="textarea" label="Description" editor="markitup" textile="true" order="1" size="m" /> </span>
I can see a album date when I look at the albums that have been added though the perch user interface. But I can t see a date here!
I have this on my album_listing.html template which looks more useful. Its from the nest example. It sets a date using timestamp - so I'm not too sure what the field is called...
<div class="col-sm-6">
</div> <!-- end column-6 -->
Ok, it looks like it's just called
date
. SoThank you! Thats worked