I would like to have navigational links above my site to navigate between "pages" (not rows).
"First" should take the visitor to the first page.
"Last" should take the visitor to the last page.
and so on...
I have part of the code which is not designed for per page purposes and is designed for per row.
Can someone please help me to modify it and make it for per page usage?
For instance if I click on "Last", instead of taking me to the last page (which should have 3 rows in there), it takes me directly to the last row (with 1 row in there).
"First" should take the visitor to the first page.
"Last" should take the visitor to the last page.
and so on...
I have part of the code which is not designed for per page purposes and is designed for per row.
Can someone please help me to modify it and make it for per page usage?
For instance if I click on "Last", instead of taking me to the last page (which should have 3 rows in there), it takes me directly to the last row (with 1 row in there).
Code:
<!--- set next back variables --->
<CFSET RowsPerPage = 10>
<CFPARAM NAME="URL.StartRow" DEFAULT="1" TYPE="numeric">
<!--- We know the total number of rows from query --->
<CFSET TotalRows = GetResult.RecordCount>
<!--- Last row is 10 rows past the starting row, or --->
<!--- total number of query rows, whichever is less --->
<CFSET EndRow = Min(URL.StartRow + RowsPerPage - 1, TotalRows)>
<!--- Next button goes to 1 past current end row --->
<CFSET StartRowNext = EndRow + 1>
<!--- Back button goes back N rows from start row --->
<CFSET StartRowBack = URL.StartRow - RowsPerPage>
<!--- end set next back variables --->
<CFSET DisplayingCount = TotalRows-URL.StartRow>
<CFIF DisplayingCount GT 10>
</CFIF>