Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Artspan #1
Need help with some code
I need to show several items on a page, in horizontal rows with 6 or 7 items to
a row. I have the first row, but I don't know what code I need to change to get
the next 6 or 7 to show on the next row. Here's the code: THANKS!!
<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfparam name="PageNum_Salesmen" default="1">
<cfquery name="Salesmen" datasource="AIOproducts.mdb">
SELECT Salesmenprods.Product_Class, Salesmenprods.SKU,
Salesmenprods.Thumbnails, Salesmenprods.Category, Salesmenprods.Name,
Salesmenprods.Metatags FROM Salesmenprods ORDER BY Salesmenprods.Name
</cfquery>
<cfset MaxRows_Salesmen=6>
<cfset
StartRow_Salesmen=Min((PageNum_Salesmen-1)*MaxRows_Salesmen+1,Max(Salesmen.Recor
dCount,1))>
<cfset
EndRow_Salesmen=Min(StartRow_Salesmen+MaxRows_Sale smen-1,Salesmen.RecordCount)>
<cfset TotalPages_Salesmen=Ceiling(Salesmen.RecordCount/MaxRows_Salesmen)>
<cfset QueryString_Salesmen=Iif(CGI.QUERY_STRING NEQ
"",DE("&"&XMLFormat(CGI.QUERY_STRING)),DE("")) >
<cfset
tempPos=ListContainsNoCase(QueryString_Salesmen,"P ageNum_Salesmen=","&")>
<cfif tempPos NEQ 0>
<cfset QueryString_Salesmen=ListDeleteAt(QueryString_Sale smen,tempPos,"&")>
</cfif>
<!--- Include the header --->
<cfinclude template="/Included_Templates/aioheader.cfm">
<link href="mainStylesheet.css" rel="stylesheet" type="text/css" />
<!--
.style1 {font-size: 10pt; line-height: 12pt; font-weight: bold;
text-decoration: none; padding-right: 3px; padding-left: 3px; font-family:
Arial, Helvetica, sans-serif;}
body {
background-color: #CECECE;
}
-->
<!--- Your page goes here --->
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
//-->
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<cfoutput><div align="center"><p class="redhead">#Salesmen.Category#'s
Equipment<br />
<a
href="#CurrentPage#?PageNum_Salesmen=#Min(Incremen tValue(PageNum_Salesmen),Total
Pages_Salesmen)##QueryString_Salesmen#" class="copy2">See More Products
</a><span class="copy2">> <<a
href="#CurrentPage#?PageNum_Salesmen=#Max(Decremen tValue(PageNum_Salesmen),1)##Q
ueryString_Salesmen#" class="copy2">Back to last page<br>
<br>
</a></span></p>
</div></cfoutput>
<table width="25%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr> <cfoutput query="Salesmen" startrow="#StartRow_Salesmen#"
maxrows="#MaxRows_Salesmen#">
<td width="100%" height="134" valign="top"><p align="center"><a
href="#Salesmen.Thumbnails#"><img src="#Salesmen.Thumbnails#" alt="Salesmen's
racks, bags, cases, and accessories" name="Salesmen" width="117" height="117"
border="0" class="pixbox" id="Salesmen"/></a><br>
<span class="productname">#Salesmen.Name#<br>
#Salesmen.Product_Class#</span><span class="copy2"><br>
<span class="clickonimage">Click image for details </span>
</span></p>
</td>
</cfoutput></tr>
<cfoutput query="Salesmen" startRow="#StartRow_Salesmen#"
maxRows="#MaxRows_Salesmen#"></cfoutput>
</table>
Artspan Guest
-
Why doesn't the Code Completion occur in FlexBuilder IDEwhen source code is in an external file?
I am seperating my .as from the MXML by using the following in my file.mxml: <mx:Script source="file.as"> When I edit file.as, the code... -
How would I include the Open Browser code into this lineof code?
Hello and thankyou in advance: I have an ASP page linked to my database and I want to apply the Open Browser behaviour to the code. I have tried... -
Custom control fires event but ignores some code in the code behind file
I do not quite understand the question. I will merely point out that most programming problems happen for a reason. Code works the way it is... -
Custom tool warning: DiscoCodeGenerator unable to initialize code generator. No code generated.
I created a brand new WebService (HelloWorld) and when I attempt to add this WebService to a WindowsForm project I get the following error message in... -
Security problem with Managed Code calling Unmanaged Code in a Web Page
Hello, I have a web page which contains an ActiveX control (unmanaged) and a Windows Forms User Control (managed). Both reside on a web page and... -
LuckyNinja #2
Re: Need help with some code
This should work its set to repeat on 8 items per row. you can change it
though.
<table width="25%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr> <cfoutput query="Salesmen" startrow="#StartRow_Salesmen#"
maxrows="#MaxRows_Salesmen#">
<td width="100%" height="134" valign="top"><p align="center"><a
href="#Salesmen.Thumbnails#"><img src="#Salesmen.Thumbnails#" alt="Salesmen's
racks, bags, cases, and accessories" name="Salesmen" width="117" height="117"
border="0" class="pixbox" id="Salesmen"/></a><br>
<span class="productname">#Salesmen.Name#<br>
#Salesmen.Product_Class#</span><span class="copy2"><br>
<span class="clickonimage">Click image for details </span>
</span></p>
</td>
<cfscript>
if (Salesmen.CurrentRow mod 8 eq 0 AND NOT Salesmen.CurrentRow eq
Salesmen.RecordCount) {
writeoutput("</tr><tr>");
}
</cfscript>
</cfoutput>
</table>
LuckyNinja Guest
-
Artspan #3
Re: Need help with some code
Thank you. Unfortunately, this doesn't work. It still comes up as only one row. Any other suggestions?
Thanks much!
Artspan Guest
-
LuckyNinja #4
Re: Need help with some code
Sorry about that didn't really have much time to test it on your code but that
little cfscript snippet work. That code is from a working site i did a while
back let me post up the whole page that its from and you can try to manipulate
it from there.
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="regText">Check out pictures from past classes,
graduation parties, flair competitions and much, much more.</td>
</tr>
<tr>
<td height="1"> </td>
</tr>
<tr>
<td height="105" valign="top">
<div id="sideBar">
<table width="90" border="0" cellspacing="0" cellpadding="0"
align="center">
<tr>
<cfoutput query="qGallery" group="galleryID">
<td align="center" valign="top">
<table width="85" border="0" align="left" cellpadding="3"
cellspacing="0">
<tr>
<td align="center" valign="top"><a
href="detail.cfm?galleryID=#qGallery.galleryID#">< img
src="/assets/images/gallery/thumbs/#qGallery.fileName#"
alt="#qGallery.galleryName#" width="75" height="75" border="1"
align="absmiddle" style="border-color:##003366"><br>
</a><a href="detail.cfm?galleryID=#qGallery.galleryID#"
class="regText">#qGallery.galleryName#</a></td>
</tr>
</table></td>
<cfscript>
if (qGallery.CurrentRow mod 8 eq 0 AND NOT qGallery.CurrentRow eq
qGallery.RecordCount) {
writeoutput("</tr><tr>");
}
</cfscript>
</cfoutput>
</table></div>
</td>
</tr>
</table>
LuckyNinja Guest



Reply With Quote

