All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Non-encoded query string, keywords and pagination base problem!

ngoncom 12 Jul 2018 04:56 question, complete

Hi Low,

I have a simple search form with textinput:

{exp:low_search:form result_page="search"} 
<input type="text" name="keywords" value="{exp:low_search:keywords}" />
<button type="submit"></button>
{/exp:low_search:form}


And my template group search:
{exp:low_search:results 
channel="test"
limit="3"
paginate="bottom"
paginate_base="search{low_search_query_string}"
}
<p>{title}</p>
{/exp:low_search:results}


My problem is I using non-encoded query string, search work well but there is a problem with pagination.

My link to search page 2 have url:
website.com/search?keywords=red+car/P3


But when I click this link, my keywords in search form became "red+car/P3" (not "red+car") and pagination wrong.

Thank so much!

Replies

  1. Low 12 Jul 2018 06:37

    You shouldn't use a {low_search_ variable inside a Low Search tag parameter. Instead, the pagination should sort it out automatically, without the need of a pagination_base parameter.

    the /P3 segment is part of the path of a URL, which always comes before a query string, so it should look like /search/P3?keywords=red+car

    If the query string is not added to the pagination URLs automatically, you can do it manually, by using

    href="{pagination_url}?{current_query_string}"


    in your pagination_links variable pair. https://docs.expressionengine.com/lat...

  2. ngoncom 12 Jul 2018 08:37

    Oh oh, I did this, it works.

    Thank you, Mr Low!