Page 1 of 1

Help sorting news articles

Posted: Mon Jul 16, 2012 4:22 pm
by numero7
my configuration
Cms Version: 1.10.3 - phpversion: 5.2.17
----------------------------------------

Hi first thanks for this help/share forum, I'm new here and also in CMSMS and I really appreciate all this help source here.

Maybe my question is not in the right topic, so feel free to move it if needed :-)

I have a beginner question,
I want to order the news article feed on my page and I've seen that you can order the news summary by ascending order like the code below :

Code: Select all

{news number='4' lang='fr_FR' category='FR' moretext='INFORMATIONS' detailtemplate='biens-immobiliers-verbier' detailpage='vente' sortasc='true'}
I have a field "price" in my news article and I need to sort the news by this field (from lower to higher price).
Is it possible to do it by code or shortcode ?

Hope you will understand my question. Thank you very much

Re: Help sorting news articles

Posted: Mon Jul 16, 2012 10:51 pm
by applejack
The short answer is no you can't as the news sort is based upon date. You may be able to code this somehow in the news template but sorting by price can be tricky as 21 will sort higher than say 111. Why are you using prices for the news you may be better looking at the products module.

Re: Help sorting news articles

Posted: Tue Jul 17, 2012 6:07 am
by numero7
oh yes thanks for your advice, I will look at the product module.
regards