Instead of having a static amount of items is there a way to choose between several choices by using a DropDownList?: <select name="chooseItemsAmount" id="chooseItemsAmount"> <option value="25">25</option> <option value="50">50</option> <option value="100">100</option> <option value="200">200</option> </select>
All my attempt to to use the value of the DropDown inside the itemsPerPage variable seems to fail: <xsl:variable name="itemsPerPage" select="$chooseItemsAmount"/>
Sorry for my late reply - your solution with the qurystring was what I needed - I intented NOT to use qurystrings prior to this thread but realized that it was inevitable... :-)
Pagination with dynamic items per page
I use the this pagination script with great success... however I would like to give the user the abillity to choose between the amount of items shown.
This codesnippet displays 25 items on the page:
<xsl:param name="currentPage"/>
<xsl:variable name="result" select="SolrSearch:Search('Aalborg')"/>
<xsl:variable name="numberOfItems" select="count($result/descendant::Advertiser)"/>
<xsl:variable name="itemsPerPage" select="25"/>
<xsl:variable name="pageNumber">
<xsl:choose>
<xsl:when test="umbraco.library:RequestQueryString('side') = ''">
<xsl:value-of select="1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="umbraco.library:RequestQueryString('side')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Instead of having a static amount of items is there a way to choose between several choices by using a DropDownList?:
<select name="chooseItemsAmount" id="chooseItemsAmount">
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
</select>
All my attempt to to use the value of the DropDown inside the itemsPerPage variable seems to fail:
<xsl:variable name="itemsPerPage" select="$chooseItemsAmount"/>
Any one solved this...?
Hi Robin
What does your $chooseItemsAmount variable look like?
/Jan
Hi Robin,
You can pass the value into the XSLT in the querystring just as you do with the page number etc., just set the variable like this:
/Chriztian
Hi Chriztian,
Sorry for my late reply - your solution with the qurystring was what I needed - I intented NOT to use qurystrings prior to this thread but realized that it was inevitable... :-)
\Robin
is working on a reply...