Im working on a page that that will show two different things on the first page it will show a table full of people and it will start a much longer list that will run on multiple pages.
Basically I want it to place the table of people and 30 rows of plays on the first page and just 55 rows of plays on the rest but instead it puts 30 rows on all the pages for the first period and 55 on the pages for any other period.
If you have any clue of a way to fix this it would be much appreciated. In my mind it would just be so much easier to have a first page function but im welcome to any ideas.
Assuming that when you say "first page", you are paginating through the data on the same URL so using a QueryString value to find the page of results. You can get the current page with
<xsl:variable name="page"> <xsl:choose> <!-- first page --> <xsl:when test="number($qStringPage) <= 1 or string($qStringPage) = '' or string(number($qStringPage)) = 'NaN'"> 1 </xsl:when> <!-- what was passed in --> <xsl:otherwise> <xsl:value-of select="number($qStringPage)"/> </xsl:otherwise> </xsl:choose> </xsl:variable>
and then set a variable for the number of records to display with
<xsl:variable name="noRecords"> <xsl:choose> <!-- all the rest (on the last page) --> <xsl:when test="$page = 1"> <xsl:value-of select="30"/> </xsl:when> <!-- only the appropriate number for this page --> <xsl:otherwise> <xsl:value-of select="55"/> </xsl:otherwise> </xsl:choose> </xsl:variable>
and then control the records that are displayed with a calculation on the page number and number of records to display, remembering that the first is 30 and then other pages have a different number (55).
Do a calculation to work out the rows that you want to display on that pagination view, e.g. page 3 would be like (just need to extend for special case on the first page:
and then when you are writing out the rows when the position is within this range
<xsl:for-eachselect="play"> <xsl:if test="Position() > $startPos and Position < $endPos"> <xsl:comment>Write out row</xsl:comment> .... </xsl:if> </xsl:for-each>
is there a way to do if test="first page" ??
Im working on a page that that will show two different things on the first page it will show a table full of people and it will start a much longer list that will run on multiple pages.
Basically I want it to place the table of people and 30 rows of plays on the first page and just 55 rows of plays on the rest but instead it puts 30 rows on all the pages for the first period and 55 on the pages for any other period.
If you have any clue of a way to fix this it would be much appreciated. In my mind it would just be so much easier to have a first page function but im welcome to any ideas.
Thanks, Dalton
Dalton,
Assuming that when you say "first page", you are paginating through the data on the same URL so using a QueryString value to find the page of results. You can get the current page with
and then set a variable for the number of records to display with
and then control the records that are displayed with a calculation on the page number and number of records to display, remembering that the first is 30 and then other pages have a different number (55).
Thanks a lot Im pretty sure that will work but Im just not sure where to apply the two variables?
Do a calculation to work out the rows that you want to display on that pagination view, e.g. page 3 would be like (just need to extend for special case on the first page:
and then when you are writing out the rows when the position is within this range
is working on a reply...