Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Warning

Yikes! Major work in progress alert.

Customising the look of pagination has always been a bitc...... a bit difficult. Lets make it easier shall we.

...

Code Block
<skin:pagination qRecordSet="qAllMyCustomers">
&nbsp;&nbsp; &nbsp;   <cfdump var="#stObject#" expand="false" label="stObject" />
</skin:pagination>

TO CUSTOMISE THE PAGINATION OUTPUT, CREATE YOUR OWN farPagination webskin. The default is displayLinks.cfm

Code Block

<cfoutput>
<cfif getPageTo() GT 1>
	<cfoutput>
	<div class="paginationpaginator-wrap">
&nbsp;&nbsp; <p>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <skin:buildPaginationLink stLink="#getLink('first')#" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <skin:buildPaginationLink stLink="#getLink('previous')#" linkText="<<" />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 		<div class="paginator">	
			#renderLink(linkid="previous", linkText="< previous")#
			
			<cfloop from="#getPageFrom()#" to="#getPageTo()#" index="i">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <skin:buildPaginationLink stLink="#getLink(i)#" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </cfloop>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <skin:buildPaginationLink stLink="#getLink('next')#" linkText=">>" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <skin:buildPaginationLink stLink="#getLink('last')#" />
&nbsp;&nbsp; </p>
&nbsp;&nbsp; <h4>Page #getCurrentPage()# of #getTotalPages()#</h4>
</div>
</cfoutput>

				#renderLink(linkid=i)#
			</cfloop>
			
			#renderLink(linkid="next", linkText="next >")#
		</div>
	</div>
	</cfoutput>	
</cfif>

EXAMPLE CODE:

Code Block

<skin:pagination
query="#yourquery#"
typename="yourtypename"
recordsPerPage="#stobj.numitems#"> 
	
<skin:view objectid="#stobject.objectid#" typename="yourtypename" webskin="#stObj.displaymethod#" />

</skin:pagination>

Basically the skin:pagination tag manages the loop, and provides you with a new #request.stobject# variable with the contents of the current row each loop.

You can rename this variable using the r_stobject="myVar" attribute.

Check farcry\core\packages\forms\farPagination.cfc for all available methods and attributes.