mulikp Posted November 25, 2022 Share Posted November 25, 2022 Hi all, I have a gallery section on site, where I have shown year-wise images and this section utilizes pagination. when you click on page 2 you will be able to see all the images that were posted in 2021 and on page 3 you will be able to see the year 2020's images. and I want to display years in descending order(i.e.: 2022, 2021,2020,.....) instead of 1,2,3 on pagination. Pleas find the below attached image to see the structure I've created for gallery section in a processwire: and this is how I fetch data on my page : and the below code is for pagination : And this is how my section looks like : I'm not sure how to go about this so any direction would be helpful. Thanks Link to comment Share on other sites More sharing options...
gebeer Posted November 25, 2022 Share Posted November 25, 2022 Why did you create a new user account to ask the same question like again? This could be considered spam. You should better ask follow up questions in your first thread. Did you read @millipedia's answer? It pretty much explains how you would go about. For rendering your "pagination" links you can use something like this simplified sample code: foreach ($mygallery as $gallery) { echo "<a href='{$mygallery->url}{$gallery->title}'>{$gallery->title}</a>"; } 1 Link to comment Share on other sites More sharing options...
mulikp Posted November 27, 2022 Author Share Posted November 27, 2022 Ohhhh I am really sorry @gebeer I didn't saw millipedia's reply. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now