• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Need Help Displaying Query

New Here ,
Jan 22, 2008 Jan 22, 2008

Copy link to clipboard

Copied

I am having problems with this, I need to re-write this into 3 different routes the CFIF can take. Currently this works because the query only returns 9 records, they are being displayed as 3 rows with 3 columns. I need to re-write and have it where if the record count is LT9 to only have the output be on 2 columns with 3 rows....and if the count is LT6 then i only want 1 row with 3 columns. I am having problems figuring out how to modify this code to accomplish this task. Any help would be greeeeeeeeeeeeat.

<cfif alsobought_counter LTE 9>
<cfif (prodCount+(detailsColCount-1)) MOD detailsColCount EQ 0><div class="clearfix"></cfif>
<div class="productThumbCont">
<cfset product_link = link("product", alsoBought_product_id, product_title)>
<div class="productThumbImg">
<a href="#product_link#" class="picksLink" title="#linktitle#"><img src="#cfimage[alsobought_counter].thumb.path#" alt="" border="0"
tooltip="#alsoBought_product_id#" />
<cfif len(trim(qryAlso_Bought.is_ondemand)) and qryrelated_products.is_ondemand EQ 1 AND qryAlso_Bought.is_disabled
NEQ 1 AND request.allowVOD eq 1><div class="on-demand-call-out"
style="cursor:pointer;margin-top:-22px;margin-top:-25/**/px;margin-left:21px;background:
url(../skins/graphics/btns/ondemand-overlay.gif) 0 0
no-repeat;width:79px;height:22px;filter:alpha(opacity=80);-moz-opacity:.80;opacity:.80;"></div></cfif></a>
</div>
<div class="productThumbTitle">
<a href="#product_link#" class="picksLink"
title="#linktitle#">#product_title#<cfif len(trim(extendedTitle))>
(#extendedTitle#)</cfif></a>
<!--- <cfif len(trim(qryAlso_Bought.hotmovies_id)) AND
qryAlso_Bought.is_disabled NEQ 1 AND request.allowVOD eq 1><div
style="padding-top:5px;"><img
src="../skins/graphics/btns/ondemand.gif" alt="Available On-Demand"
border="0" /></div></cfif> --->
</div>
</div>
<cfif prodCount MOD detailsColCount EQ 0></div></cfif>
<cfset prodCount = IncrementValue(prodCount)>
<cfset alsobought_counter = IncrementValue(alsobought_counter)>
</cfif>
</cfoutput>
<cfif (prodCount-1) MOD detailsColCount NEQ 0></div></cfif>
</div> Text
TOPICS
Advanced techniques

Views

265

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 22, 2008 Jan 22, 2008

Copy link to clipboard

Copied

After you run your query, look at the record count. Run all the if/else logic you have to to determine the number of columns you want. Don't worry about the number of rows, that will take care of itself.

Once you have the number of columns figured out, output your data as simply as possible, no style tags, no links, just data. Use the modulus operator to decide when to start a new row.

Once you've accomplished that, start adding the rest of your stuff.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 23, 2008 Jan 23, 2008

Copy link to clipboard

Copied

LATEST
I think that's my issue, I don't understand where the rows and columns are really coming from.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation