We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

dynamic_parameters on search results page?

Development and Programming

adambeazley's avatar
adambeazley
153 posts
10 years ago
adambeazley's avatar adambeazley

Hello,

I have a large archive list that is built utilizing channel entries and it has up/down buttons in a few key rows that allow the user to dynamically sort the data according to the column and asc/desc. I would like that functionality to work on the search results page as well.

I have a simple search form which send the user to a search results page with the same code, but I cant figure out how to get the special encoded search string in segment_3 of the URL into the {path="my-path/search_results"} EE tag that is in the form that controls the dynamic sorting.

So my button form code looks something like this:

<form method="post" action="{path='employees/archive-search-results'}">
     <input type="hidden" name="csrf_token" value="{csrf_token}" />
         <input type="hidden" name="orderby" value="year_published" />
         <input type="hidden" name="sort" value="asc" />
         <input type="submit" value=""/>
        </form>

and the URL on the search results page looks something like this:

www.website.com/employees/archive-search-results/6fb1bbfc8c192cc69b7894f73685bf7c/

So I guess I need to find a way to get the segment_3 (6fb1bbfc8c192cc69b7894f73685bf7c) string into the method=”post” action=”{path='employees/archive-search-results/??????????????????????????'}”> form code.

Any ideas? recommendations?

       
adambeazley's avatar
adambeazley
153 posts
10 years ago
adambeazley's avatar adambeazley

So I didnt realize I could use {segment_3} tag inside of a path tag, but I can. Unfortunately this did not solve my problem, it only displays the results just the way they are… it does not resort the results.

Any insight would be very helpful.

       
Boyink!'s avatar
Boyink!
5,011 posts
10 years ago
Boyink!'s avatar Boyink!

IMHO you’re barking up the wrong tree trying to get the native search to do this. Simple search is…simple..😉

Probably a better idea to look at Solspace Super Search or Low Search for options.

       
adambeazley's avatar
adambeazley
153 posts
10 years ago
adambeazley's avatar adambeazley

yea i had looked at them and they are just too beefy…. the simple search results are great and just what I need, i was just hoping to get this little issue fixed. I can always remove the sort buttons, its not like the results are that hard to glance through.

The other thing i was looking at was resubmitting search keywords when one of the sort buttons is pushed. Are sort and sort_by even an option int he search results? I just cant seem to find much information on the search results page?

       
Boyink!'s avatar
Boyink!
5,011 posts
10 years ago
Boyink!'s avatar Boyink!

https://ellislab.com/expressionengine/user-guide/add-ons/search/results.html#parameters

No sort parameters.

       
adambeazley's avatar
adambeazley
153 posts
10 years ago
adambeazley's avatar adambeazley

:( you make me sad Boyink

       
Boyink!'s avatar
Boyink!
5,011 posts
10 years ago
Boyink!'s avatar Boyink!

I’m just the messenger! 😉

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.