Changing Search Results Order
Ok.. I almost got it…
Just add the input field you wish in th HTML between the {exp:search} tags… for instance:
{exp:search:advanced_form}
<input type="hidden" name="sort_order" value="asc/des" />
<input type="hidden" name="orderby" value="nameofthefield" />
<…rest of the form…>
{/exp:search:advanced_form}
This way when the template is parsed this fields are included on the search form…
It sounds simple, but due to a mental lock-down from my brain I spent almost two days getting this to work ...duh!
Question for the pros:
Can I use this mechanism to sort by a custom weblog fields? what should iI use as the value? the “name” of the field or it’s database counterpart (field_id_n)?