Non-encoded query string, keywords and pagination base problem!
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
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
in your pagination_links variable pair. https://docs.expressionengine.com/lat...
ngoncom 12 Jul 2018 08:37
Oh oh, I did this, it works.
Thank you, Mr Low!