Frustrated!

Problem: I have an array that stores items for multiple categories and
subcategories.

ITEMS IN THIS MAIN CATEGORY:

Eg: Category X
*       Sub Category : A,B,C,D
Eg: Category Y
*       Sub Category : E,F,G,H,

______________________________

ITEMS IN NEXT MAIN CATEGORY:

Eg: Category X
*       Sub Category: A,B,C,D
Eg: Category X
*       Sub Category: A,D,U, blank space for 4th item,
Eg: Category X
*       Sub Category: A,D,U,G,


I need to display 4 items per line regardless of if the array holds 3 items
or less in a particular category, or more than 3 items!
If the is less than 4 items the add a blank space for the missing item.

I have posted the heart of my code below!

Thanks for your help in advanceĀ…

The database holds a list of all products categories and subcategories.

<cfif ListContains(Results.product_Name, "Foundation") NEQ 0 OR
ListContains(Results.product_Name, "Powder") NEQ 0 OR
ListContains(Results.product_Name, "Shadow") NEQ 0 OR
ListContains(Results.product_Name, "Lip Shine") NEQ 0 OR
ListContains(Results.product_Name, "Lipstick") NEQ 0 OR
ListContains(Results.product_Name, "Blush") NEQ 0>
                          <cfset totalModValue2=totalArray[categoryNumber]
mod 4>
                          <!---modValue2 ADJUSTS THE VALUE OF THE MOD TO
ENSURE THAT EVEN IF A PRODUCT IS REMOVED...ALL
                                          THE PRODUCTS WILL STILL BE
ALIGNED. PROBLEMS OCCUR WHEN MORE THAN ONE IS REMOVED.--->
                            <cfswitch expression="#totalModValue2#">
                                      <cfcase value="1">
                                        <cfset modValue2="-1">
                                      </cfcase>
                                      <cfcase value="2">
                                        <cfset modValue2="-2">
                                      </cfcase>
                                      <cfcase value="3">
                                        <cfset modValue2="-3">
                                      </cfcase>
                                      <cfdefaultcase>
                                      </cfdefaultcase>
                                    </cfswitch>
                                    <cfif ListContains(Results.product_Name,
"Shadow") NEQ 0>
                                    <!--- Debugging! --->
                                      <cfoutput>ModValue2:
#modValue2#</cfoutput> modValue2 VALUES

<!--- Debugging End! --->
                                    </cfif>
                          <cfif NOT Results.CurrentRow eq
Results.RecordCount AND  (Results.CurrentRow+modValue2) mod 4 eq 0 >
                                    <cfset categoryNumber=categoryNumber+1>
<!--Increment this variable to access the correct

row size from the array--->
                                    </tr><tr>
                          </cfif>
                        <cfelse>
                        <!--- Debugging! --->
                            <cfoutput>#totalArray[8]#</cfoutput>
                                                <!--- Debugging END! --->
                            <cfset totalModValue=totalArray[8] mod 3>
                            <cfswitch expression="#totalModValue#">
                                      <cfcase value="1">
                                        <cfset modValue="-2">
                                      </cfcase>
                                      <cfcase value="2">
                                        <cfset modValue="-3">
                                      </cfcase>
                                      <cfdefaultcase>
                                        <cfset modValue="-1">
                                      </cfdefaultcase>
                                    </cfswitch>
                                    <!--- Debugging --->
                                    <cfoutput>modValue
:#modValue#</cfoutput>
                                    <!--- PRINTS OUT MOD VALUE --->
            <cfif NOT Results.CurrentRow eq Results.RecordCount AND
(Results.CurrentRow+modValue) mod 3 EQ 0 >
              </tr><tr>
                      <!---Debug ---> #Results.CurrentRow#
(#Results.RecordCount#) <!--- Debug End --->
            </cfif>
    </cfif>






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235661
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to