How can I sort #ask results alphanumerically in MediaWiki?

0

I am using the Semantic MediaWiki and have this #ask query:

{{#ask: [[Category:Journals]]
| ?Has Rating
}}

The "Has Rating" has as allowed values: TOP25, TOP10, TOP5, and TOP1. How can I get the sort (asc or desc) to sort alphanumerically, so that TOP1 < TOP5 < TOP10 < TOP25?

Egon Willighagen

Posted 2013-08-14T14:02:00.877

Reputation: 457

Answers

0

Hmm, it does not seem like it is supported natively, according to this page, but one could of course always hack around it with a hidden field without the text part (auto-populated with a call to parserfunctions, in a template, that cuts out just the number) (UGLY) or create a hacked javascript sorter. Not sure which one I would go for personally...

Samuel Lampa

Posted 2013-08-14T14:02:00.877

Reputation: 525

1Well, an easier hack would be to use TOP01 and TOP05 ... but I was hoping for something less hacky :) – Egon Willighagen – 2013-08-14T18:31:10.573