forms - Umbraco XSLT search page navigation using input onchange -


I have created a paging input that will go to the value entered on the input in the input.

Enter image details here

This page category address And will allow navigation between those pages, /image-gallery-album-1.aspx?page=3

  & lt; Form type = "go" onchange = "return false" & gt; & Lt; Div class = "pagerUI" & gt; & Lt; Table range = "0" cell field = "0" cellpadding = "0" & ​​gt; & Lt; TR & gt; & Lt ;! - previous page - & gt; & Lt; Xsl: if test = "$ page & gt; 1" & gt; & Lt; Td class = "pager-prev" & gt; A class = "previous" href = "{concat ('? Page =', $ page - 1, $ qs)}" title = "previous page" & gt; & Amp; # 8249; & Lt; / A & gt; & Lt; / TD & gt; & Lt; / XSL: If & gt; & Lt; TD & gt; Page & lt; / TD & gt; & Lt; Td> & Lt; Input type = "number" name = "page" id = "page" minute = "1" & gt; & Lt; XSL: Select & gt; & Lt; Xsl: when test = "$ page = 1" & gt; & Lt; Xsl: attribute name = "value" & gt; 1 & lt; / Xsl: attribute & gt; & Lt; / XSL: When & gt; & Lt; XSL: otherwise & gt; & Lt; Xsl: attribute name = "value" & gt; & Lt; Xsl: Select the value = "$ current page number" /> & Lt; / XSL: Specialty & gt; & Lt; / XSL: otherwise & gt; & Lt; / XSL: Select & gt; & Lt; Xsl: attribute name = "max" & gt; & Lt; Xsl: Select Value = "$ numberOfPages" /> & Lt; / XSL: Specialty & gt; & Lt; / Input & gt; & Lt; / TD & gt; & Lt; Td> & Lt; Xsl: Select Value = "$ numberOfPages" /> & Lt; / Td> & Lt ;! - Next page - & gt; & Lt; Xsl: if test = "$ page * $ resultpage page & math ($ matched nodes)" & gt; & Lt; Td class = "pager-next" & gt; One class = "next" href = "{concat ('? Page =', $ page + 1, $ qs)}" title = "next page" & gt; & Amp; # 8250; & Lt; / A & gt; & Lt; / TD & gt; & Lt; / XSL: If & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Div & gt; & Lt; / Form & gt;   

However, when I add it to the XSLTSearch code it does not work because the URL looses search string.

Instead of navigating to: /image-search.aspx?search=football&page=3

navigates this to: /image-search.aspx?page=3 Display any results on the page that does not, because there is a shortage of search criteria for displaying search results.

I tried to change the form and included an "action", which will replace the URL to include the search value, but I do not include the input value as dynamic.

For example, if I enter a value in the input then the url updates to: /image-search.aspx?search=otbra& Page = The entry number of input value is missing in it.

Search form with on-line and action and method post attributes:

  & lt; Form type = "go" onchange = "return false" & gt; & Lt; Xsl: attribute name = "method" & gt; & Lt; XSL: Text & gt; Post & lt; / XSL: text & gt; & Lt; / XSL: Specialty & gt; & Lt; Xsl: attribute name = "action" & gt; & Lt; XSL: Text & gt; Search = & lt; / XSL: text & gt; & Lt; Xsl: Select the value = "$ search" /> & Lt; Xsl: text & gt; And & lt; / Xsl: text & gt; Page = (input value) & lt; / Xsl: attribute & gt;   

Is there a way to parse and parse the value stored in some Javascript or URL's search string?

Any support will be appreciated. Cheers, JV

Note: with potential problem $$ as a comment on your post QS variable, however, is an explanation for how you can get query string values ​​in Ombraco for reference.


In Umbraco you have a query string value in XSLT Umbraco.library

then retrieving the value of the search You will say something like this:

  & lt; Xsl: variable name = "searchValue" select = "umbraco.library: RequestQueryString ('search')" />   

This creates a variable search valve that you can use to re-add the query string value to your URL.

Something like this: & lt; A class = "next" href = "{concat ('' page = ', $ page + 1', & amp; search = ', $ searchValue)}" title = "next page" & gt; & Amp; # 8250; & Lt; / A & gt;

can be found on the site.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -