Question about permalinks

Discussion corner for Developers of Serendipity.
Post Reply
Ch.h.
Posts: 2
Joined: Sat Nov 11, 2006 11:04 pm

Question about permalinks

Post by Ch.h. »

Hi folks,

I got a question about permalinks and I searched both the docs and the forums for a solution, but I couldn't find any, so I have to ask you:

Is it possible to sort entries ascending by passing an argument over to a permalink like this one:

Code: Select all

http://[host]/news/categories/1-Termine
I wanted to call the appointment (Termine) category with a link in my main navigation, with the next appointment on top.

There is perhaps an easy solution, but I'm so tired right now that I could miss it even when it's in front of me :s

Thanks in advance,
Chris
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Question about permalinks

Post by garvinhicking »

Hi!

Usually all entries are sorted chronologically, so you should always see the most recent entry of a category on top of your entry listing?

You can't change the sort order of the display with permalinks, I'm sorry. You would either need to create a PHP plugin for that, or edit the include/genpage.inc.php file and patch the serendipity_FetchEntries() function to pass the DESC/ASC order parameter.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Ch.h.
Posts: 2
Joined: Sat Nov 11, 2006 11:04 pm

Re: Question about permalinks

Post by Ch.h. »

garvinhicking wrote:Usually all entries are sorted chronologically, so you should always see the most recent entry of a category on top of your entry listing?
See, that's the problem... I wanted the entries to be sorted the other way round because the next appointment should be on top and the future (!) ones should follow...
garvinhicking wrote:You can't change the sort order of the display with permalinks, I'm sorry. You would either need to create a PHP plugin for that, or edit the include/genpage.inc.php file and patch the serendipity_FetchEntries() function to pass the DESC/ASC order parameter.
Isn't there a plugin with which you can pass aguments over to permalinks? I thought I saw something like this in Spartacus...
I only need to reverse the sort order for this special page...
There is one category in my navigation called "News", where the serendipity index is called (with an event_plugin to hide the "termine" category) and one called "Termine" where this Permalink I talked about should call the reversed appointment list.

Isn't there an easy solution to this?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Question about permalinks

Post by garvinhicking »

Hi!
Isn't there a plugin with which you can pass aguments over to permalinks? I thought I saw something like this in Spartacus...
Maybe you mean the "custom archive" event plugin, there you cna have a select field to change the order of entries. Maybe you can even add the "?serendipity[order]=DESC/ASC" parameter to your URL to make that automatted, you could have a try?

If you know some PHP, there is an easy solution by building your own plugin and setting a variable that is passed to serendipity_fetchEntries in the include/genpage.inc.php file...of course, only if the mentioned plugin doesn't do the trick ;)

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply