I have thumbnail images -
The way it's laid out is by 5's per line.
The code that I have will only generate 1 per line.
How do I make this code generate 5 images per line with a maximum output of 15 per page with a link to the next 15?
Here is the code that generates 1 image per line. It works great but does not fit my design.
Can anyone help?
--------Code--------------------
<table width="500" cellspacing="10" cellpadding="10" border="0">
<tr>
<td valign="top" width="500">
<!--- Set the number of records to display on each page. --->
<CFSET OnEachPage = 15>
<!--- Set the default startrow to 1 if a value was not passed. --->
<!--- Determine whether or not to show the previous or next links. --->
<CFPARAM NAME = "StartRow" DEFAULT = "1">
<!--- Set the value of endrow to the maxrows + startrow - 1 --->
<CFSET EndRow = StartRow + OnEachPage - 1>
<!--- If the end row is greater than the recordcount, determine how many records are left. --->
<CFIF EndRow GTE getThumb.RecordCount>
<CFSET EndRow = getThumb.RecordCount>
<CFSET Next = false>
<!--- Othereise, set Next to true and determine the next set of records. --->
<CFELSE>
<CFSET Next = true>
<CFIF EndRow + OnEachPage GT getThumb.RecordCount>
<CFSET NextNum = getThumb.RecordCount - EndRow>
<CFELSE>
<CFSET NextNum = OnEachPage>
</CFIF>
<CFSET NextStart = EndRow + 1>
</CFIF>
<!--- If StartRow is 1, set Previous to false. --->
<CFIF StartRow IS 1>
<CFSET Previous = false>
<!--- Othewise, determine the previous set of records. --->
<CFELSE>
<CFSET Previous = true>
<CFSET PreviousStart = StartRow - OnEachPage>
</CFIF>
<!--- Determine how many pages will be displayed. --->
<CFSET NumPages = Ceiling(getThumb.RecordCount / OnEachPage)>
<CFPARAM NAME = "PageNum" DEFAULT = "1">
<CFOUTPUT>
Now displaying posts <FONT COLOR="Red">#StartRow# to #EndRow# of #getThumb.RecordCount#.
</CFOUTPUT>
<br>
<br>
Click on The desired Piece for More Information:
<CFOUTPUT QUERY="getThumb" STARTROW = "#startrow#" MAXROWS = "#OnEachPage#">
<br>
<br>
<a href="GalleryDetail.cfm?ProdID=#ProdID#"><img src="img/#ThumbImage#" border="1" alt="" style="border-color: Black;"></A>
</cfoutput>
<!--- If Previous is true, display the previous link. --->
<CFIF Previous>
<CFOUTPUT>
<A HREF = "galleryLook.cfm?StartRow=#PreviousStart#&PageNum=#DecrementValue(PageNum)#<CFIF IsDefined("Keyword">&Keyword=#URLEncodedFormat(Keyword)#</CFIF>"><< Previous</A>
</CFOUTPUT>
<CFELSE>
</CFIF>
<CFLOOP FROM = "1" TO = "#NumPages#" INDEX = "ThisPage">
<CFOUTPUT>
<CFIF ThisPage IS PageNum>
#ThisPage#
<CFELSE>
<CFSET PageNumStart = (((ThisPage - 1) * OnEachPage) + 1)>
<A HREF = "galleryLook.cfm?StartRow=#PageNumStart#&PageNum=#ThisPage#<CFIF IsDefined("Keyword">&Keyword=#URLEncodedFormat(Keyword)#</CFIF>">#ThisPage#</A>
</CFIF>
</CFOUTPUT>
</CFLOOP>
<!--- If Next is true, display the previous link. --->
<CFIF Next>
<CFOUTPUT>
<A HREF = "galleryLook.cfm?StartRow=#NextStart#&PageNum=#IncrementValue(PageNum)#<CFIF IsDefined("Keyword">&Keyword=#URLEncodedFormat(Keyword)#</CFIF>">Next >></A>
</CFOUTPUT>
<CFELSE>
</CFIF>
</td>
------------------------------------------
Thanks,
Eric
The way it's laid out is by 5's per line.
The code that I have will only generate 1 per line.
How do I make this code generate 5 images per line with a maximum output of 15 per page with a link to the next 15?
Here is the code that generates 1 image per line. It works great but does not fit my design.
Can anyone help?
--------Code--------------------
<table width="500" cellspacing="10" cellpadding="10" border="0">
<tr>
<td valign="top" width="500">
<!--- Set the number of records to display on each page. --->
<CFSET OnEachPage = 15>
<!--- Set the default startrow to 1 if a value was not passed. --->
<!--- Determine whether or not to show the previous or next links. --->
<CFPARAM NAME = "StartRow" DEFAULT = "1">
<!--- Set the value of endrow to the maxrows + startrow - 1 --->
<CFSET EndRow = StartRow + OnEachPage - 1>
<!--- If the end row is greater than the recordcount, determine how many records are left. --->
<CFIF EndRow GTE getThumb.RecordCount>
<CFSET EndRow = getThumb.RecordCount>
<CFSET Next = false>
<!--- Othereise, set Next to true and determine the next set of records. --->
<CFELSE>
<CFSET Next = true>
<CFIF EndRow + OnEachPage GT getThumb.RecordCount>
<CFSET NextNum = getThumb.RecordCount - EndRow>
<CFELSE>
<CFSET NextNum = OnEachPage>
</CFIF>
<CFSET NextStart = EndRow + 1>
</CFIF>
<!--- If StartRow is 1, set Previous to false. --->
<CFIF StartRow IS 1>
<CFSET Previous = false>
<!--- Othewise, determine the previous set of records. --->
<CFELSE>
<CFSET Previous = true>
<CFSET PreviousStart = StartRow - OnEachPage>
</CFIF>
<!--- Determine how many pages will be displayed. --->
<CFSET NumPages = Ceiling(getThumb.RecordCount / OnEachPage)>
<CFPARAM NAME = "PageNum" DEFAULT = "1">
<CFOUTPUT>
Now displaying posts <FONT COLOR="Red">#StartRow# to #EndRow# of #getThumb.RecordCount#.
</CFOUTPUT>
<br>
<br>
Click on The desired Piece for More Information:
<CFOUTPUT QUERY="getThumb" STARTROW = "#startrow#" MAXROWS = "#OnEachPage#">
<br>
<br>
<a href="GalleryDetail.cfm?ProdID=#ProdID#"><img src="img/#ThumbImage#" border="1" alt="" style="border-color: Black;"></A>
</cfoutput>
<!--- If Previous is true, display the previous link. --->
<CFIF Previous>
<CFOUTPUT>
<A HREF = "galleryLook.cfm?StartRow=#PreviousStart#&PageNum=#DecrementValue(PageNum)#<CFIF IsDefined("Keyword">&Keyword=#URLEncodedFormat(Keyword)#</CFIF>"><< Previous</A>
</CFOUTPUT>
<CFELSE>
</CFIF>
<CFLOOP FROM = "1" TO = "#NumPages#" INDEX = "ThisPage">
<CFOUTPUT>
<CFIF ThisPage IS PageNum>
#ThisPage#
<CFELSE>
<CFSET PageNumStart = (((ThisPage - 1) * OnEachPage) + 1)>
<A HREF = "galleryLook.cfm?StartRow=#PageNumStart#&PageNum=#ThisPage#<CFIF IsDefined("Keyword">&Keyword=#URLEncodedFormat(Keyword)#</CFIF>">#ThisPage#</A>
</CFIF>
</CFOUTPUT>
</CFLOOP>
<!--- If Next is true, display the previous link. --->
<CFIF Next>
<CFOUTPUT>
<A HREF = "galleryLook.cfm?StartRow=#NextStart#&PageNum=#IncrementValue(PageNum)#<CFIF IsDefined("Keyword">&Keyword=#URLEncodedFormat(Keyword)#</CFIF>">Next >></A>
</CFOUTPUT>
<CFELSE>
</CFIF>
</td>
------------------------------------------
Thanks,
Eric