Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Control Sort order of 1I18n Search results
#1
I need to control the sort order of these results http://s418104665.onlinehome.us/index.php?id=mrast

I want the list to display in alpha order by the title of the special page. I tried changing the file name of the .xml to correct the numerical default to force the sort, but that did not work. (e.g. mrast-1.xml to mrast-01.xml) I had an error in the display of the results when the file names were changed.

I have read through the forum and the instructions and haven't been able to figure out how to make this happen. I've tried order:reverseurl and mrast order:url HEADER:' ' and also leaving out any reference to an order.

Thanks for any help or suggestions!

Edit: I would also like to have ALL results on one page. Looked but couldn't find a way to control number of results displayed on a page. It's probably a simple thing, but it's eluding me. ;-)
Reply
#2
If you have a list of items (ul / li) I'd suggest to use one of jquery sort() plugin.
Just ask uncle google, and find out what possibilities are available in regards of your case.
Addons: blue business theme, Online Visitors, Notepad
Reply
#3
Thank you for taking the time to reply with a suggestion. I think though that I just need a bit of code that will call the proper field from the special pages and sort on it and I don't know the syntax. I'm not a programmer. I reply on commented code and instructions to make things work.
Reply
#4
Hello, sarnaiz. Firstly you needn't resort to renaming the xml files directly because renaming the SLUG of the page will do that automatically for you. So simply changing the slug to mrast-01 will change the xml file to mrast-01.xml -- changing the xml filename directly like you did is also likely the source of the error you picked up, so avoid this where possible (don't worry - I only know this because I've made this mistake before as well xD).

Next, if you want alphabetical ordering then simply using order='url' should do the job for you, providing that you've used exactly the same prefix on each slug. So if you want the following to be displayed correctly:
  • Drugs
  • Trees
  • Weeds
  • Dust (where dust should be just after drugs)

Give each the corresponding slugs:
  • mrast-drugs
  • mrast-trees
  • mrast-weeds
  • mrast-dust

They should then be displayed in correct alphabetical order.

As for displaying ALL your results on the one page, I just set the maximum results displayed to a ridiculously large number. So use max='999' and your problems should be sorted.

Hope this helps you, sarnaiz!
Reply
#5
Angryboy Wrote:Hello, sarnaiz. Firstly you needn't resort to renaming the xml files directly because renaming the SLUG of the page will do that automatically for you.
Hope this helps you, sarnaiz!

HI! Thanks for responding. Unfortunately special pages do not have this field: "Custom URL (Slug):" so my only option was to change the file name which gave me the error and did not work.

The list of pages is being called by the search function of the I18n module. (% searchresults tags:mrast order:url HEADER:' ' %)

EDIT: I should mention you can set a prefix for the special page, but it is not allowing me to have a custom page slug for a special page.
Reply
#6
sarnaiz Wrote:Unfortunately special pages do not have this field: "Custom URL (Slug):" so my only option was to change the file name which gave me the error and did not work.

If you leave Slug/URL empty in the special pages configuration, you can set any slug when you edit your (special) pages.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#7
mvlcek Wrote:
sarnaiz Wrote:Unfortunately special pages do not have this field: "Custom URL (Slug):" so my only option was to change the file name which gave me the error and did not work.

If you leave Slug/URL empty in the special pages configuration, you can set any slug when you edit your (special) pages.

Thanks mvlcek!! It is now functioning as I needed. I removed my prefix from the custom slug field for the special page configuration. That allowed me to change the page slug for each custom page created with the mRast special page.

Then using (% searchresults tags:mrast max:20 order:url %) has the search results all on one page and in alpha order sorting on the page name. http://s418104665.onlinehome.us/index.php?id=mrast

Thank you *all* for help with this issue.
Reply




Users browsing this thread: 1 Guest(s)