0

How do you force the "orderby=" parameter to use a custom field like "alphabet" as the lead in Super Search.

Using it +asc doesn't work, nor does using it alone. It still prioritizes the results by entry date.

We've tried a few variations to make sure we were using it line with the documentation, but orderby="title+workers-name+asc" whereas workers-name was the custom field

Thanks in advance.

Code Sample:

{exp:super_search:search channel="workplace" orderby="title+workers_lname+asc"}
<form action="{path='workplace/search-results'}" method="post" id="search_form">
<input type="hidden" name="csrf_token" value="{csrf_token}" />
  • Are you setting this via a parameter on the results tag, or via your form's POST? Anything set in POST will override tag parameters. – Derek Hogue Nov 17 '15 at 16:14
  • OK, so now check your form and make sure you're not also setting an orderby parameter there, as it will win. – Derek Hogue Nov 17 '15 at 21:33
  • So I posted a small code sample if that helps. – jsuissa Nov 17 '15 at 21:47
  • Is your field workers-name? workers_lname? Make sure you have the name right. Let's say it's workers_lname, try orderby="title+asc+workers_lname+asc". You're missing an +asc or +desc next to title. Also, what is the fieldtype for workers_lname? That can be important because Super Search will look at the exp_channel_data table for ordering. – Solspace Nov 18 '15 at 1:48
  • Also, why is the orderby="" parameter with {exp:super_search:search}? That isn't a valid parameter (docs: solspace.com/docs/super_search_2/search/#parameters). If you want orderby in the search form, use a form field for "orderby" (users can edit this since it's a form field). If you don't want users to be able to access the "orderby" field, use the orderby="" parameter on your results template, i.e. where {exp:super_search:results} (:results, not :search) is used. – Solspace Nov 18 '15 at 1:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.