Share » Forums » Setup & design » Problem with: sort_by

Problem with: sort_by

Problem with: sort_by

Wednesday 25 May 2005 9:30:14 am - 2 replies

Modified on Wednesday 25 May 2005 9:30:37 am by Siw Helen Thorslund

Author Message

Luke Barton

Wednesday 25 May 2005 11:43:46 am

Consider this.

You could add an attribute to each article that controls its "override sort key" value.

For instance, all articles would default sort by date (or whatever you're already doing).

Then, if the user wishes to set the override sort value for a few articles, the user can set them in the order they wish:

override_sort_val = 1
override_sort_val = 2

You template logic would then search for override_sort_val first, and sort by the attribute value.

Then, your logic would sort the rest by your default sort key.

The user would be responsible for setting the override_sort_val to zero when that article was no longer controlled by override.

Hope this helps or sparks some more ideas.

-Luke

Marko Žmak

Wednesday 25 May 2005 4:59:30 pm

Or you could (without creating
override_sort_val attribute) fetch first the articles that have priority > 0 and sort them by any criterium you want. And then fetch all the rest and sort THEM also by any criterium you want.

It's easier, and convenient because priority can be updated in the admin interface in the listing.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu