Member
Member
vincent3569   01-04-2010, 22:15
#1

hello

I use zenphoto with zenpage

Is it possible to add a sorting of news in reverse chronological order?

Indeed, the loop with news (with the navigation bar), the latest news is on page 1, the oldest is on page 4 (for example).

I would like the latest news is on page 4 and the oldest is on page 1 (same example).
->button previous news would see older news
->button next news would see the latest news

maybe, by adding a sort option in the function printNewsPageListWithNav
maybe, by adding a sort option in the admin tab...

thanks for your advice

Administrator
Administrator
acrylian   02-04-2010, 08:15
#2

It is quite standard that the latest news as it is the most important is upfront. However, it is already there: http://www.zenphoto.org/documentation/plugins/zenpage/_zp-extensions---zenpage---zenpage-template-functions.php.html#functionnext_news

Member
Member
vincent3569   02-04-2010, 12:41
#3

well, it's a good news !

but is it the function printNewsPageListWithNav use these sorting options ?

see http://vincent.bourganel.free.fr/zenphoto/index.php?p=news
news1 (oldest one) is on page 2 and news4 (newest one) is on page 1.

if we are with ascending order, we should have news4 on page 2 and news1 on first page : previous is too see older news.

Administrator
Administrator
acrylian   02-04-2010, 15:46
#4

Sure that you set the parameters correctly? printNewsPageListWithNav is dependent on the loop.

Administrator
Administrator
acrylian   02-04-2010, 16:29
#5

I just tried, works as expected for me. Note you have to set both parameters.

Member
Member
vincent3569   02-04-2010, 23:04
#6

maybe there's something I do not understand.

actualy, i do a loop with

...

but navigation still not works as well and whatever sort order and sort direction, the display still the same

could you explain how set those parameters and how correctly use them with printNewsPageListWithNav ?

Administrator
Administrator
acrylian   03-04-2010, 08:44
#7

Well, you actually did it correctly except that you need of course to use "asc" (ascending) instead of "desc" (descending) to get the oldest to newest direction. The printNewsPagesListWithNav() does not require any special settings.

Member
Member
vincent3569   05-04-2010, 22:04
#8

"The printNewsPagesListWithNav() does not require any special settings. "

i'm not agree with that : it's ok if you are with ascending sort but it's not logical if you are with descending sort.

with this sort option, you should displayed the last page of news (and not the 1st one), and on navigation bar, previous page shown oldest news, next page shown newest.

Similarly, if you are on single news article, previous and next links should show oldest single news or newest single news.

what you think about it ?

Administrator
Administrator
acrylian   06-04-2010, 09:24
#9

Sorry, I can't see any issue with the printNewsPagesListWithNav() function. If you tell the next_news() loop to be ascending that function is also mirroring that. If it does not it might be your theme. Note that for example the zenpage theme has two loops!: One
on the gallery.php page if you use the "news on index" option and one on the news.php page. Of course both need to be set to asc.
See Here: http://zenphoto.maltem.de/

It might be that "title" sorting does not work correctly if using the multilingual mode though. I have to look at that.

I agree however that the prev/next links for hte single news should also be reversed (prev oldest / next newest). I will add options to those as well (I will not make this an backend option for the sake of flexibility as you can theoretically use loops on other pages as well).

Update: Tonight's nightly will have the same parameters like the next_news() function.

Junior Member
Junior Member
tagecho   09-04-2010, 10:05
#10

Thanks for solution.

Member
Member
vincent3569   09-04-2010, 19:15
#11

thanks for your help.

could you explain what the evolution is ? there's nothing in the documentation.

Administrator
Administrator
acrylian   10-04-2010, 09:01
#12

The documentation is of course only for the current official release not hte nightlies. The documentation is always in the files itself.
Look at the news.php page's single article display at the next/prev article function. You can just copy over as parameters what you set for the next_news().

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.