Page 1 of 1

Sort News by Post date desc [solved]

Posted: Mon Feb 11, 2008 1:04 pm
by sherie
Please be patient with me. This is my first CMS site. So far I'm loving what i see...

I have read documentation and done a search and read through the various answers but no-one seems to have same 'issue'...

I'm using the news module to display both news and events (different categories, each category being displayed on a seperate page).

I want to display them in post date (oldest to newest).
I also need to change the date is shown to be UK friendly.

After searching the documentation i thought I found a solution to both.

I set for the date:
dateformat="%d %B,%Y"    and the date DOES display as i want it to:eg. 08 January, 2008 .

Then for sorting by date I assumed it would use the:
sortby="news_date"         ...but absolutely nothing changes.


I have this:

{news category='Events' dateformat="%d %B,%Y" sortby="news_date" sortasc="true" lang="en_UK"}
but currently my news shows dates in following order:

08 January,2008
07 September,2007
14 February,2008

which I can only think is in ID order somehow. As it is not asc not desc.  :(

Am I simply looking at the wrong field - are news_date and Post Date the same?
Has my changing the format of the date meant that it is now not sorting correctly (cant see why)?

Anyone can shed a light on how i can change this. I'm comfotable with editing files directly (i.e files not available via admin) - is there something in Modules/News I should be fiddling with? Or is there something blindlingly obvious to a noob that I'm missing as to why the news isnt accepting the sortby function.

I'm using PHP5 on linux. mySQL version 4.1.22.
This is a clean installation of latest CMS version 1.2.3.
No Other Mods or additions.

Any help much appreciated.


Sherie

UPDATE:  After tinkering with this every which way, I hit upon the fact that sortasc="true" does work by itself. But if you use sortasc="true" with sortby="news_date" it does not work....I can use one or the other but not both together!

btw. This is a fantastic program....

Re: Sort News by Post date desc [solved]

Posted: Fri Apr 18, 2008 6:49 pm
by OlafNoehring
Hi

thanks for the Update - this helped me as well (but what I needed was sortasc="false" .... :-) )

Olaf