Link to home
Start Free TrialLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

where would I put this code???

Hi,

Oh, I have this piece of code that I know it would display 5 names per row. but
I am not sure where to put it here.
so, since my brain is blinking Maybe someone somewhere somehow can help me.
thank you,
lulu
This is the code I want to <br> after 5 names
<cfif currentRow mod 5 eq 0>

<CFQUERY DATASOURCE="xxx" NAME="DispMainMenu" cachedwithin="#createTimeSpan(0,0,0,-1)#">
 SELECT MainMenuName, MenuID, MainMenuURL, RelIDMainMenu, MainMenuStatus
   FROM MainMenu where MainMenuStatus = 'A' 
 ORDER BY MainMenuOrderBy
</CFQUERY>

<CFQUERY DATASOURCE="xxx" NAME="DispSubMenu" cachedwithin="#createTimeSpan(0,0,0,-1)#">
SELECT MainMenu.MenuID,SubMenuName,SubMenuURL,DivID 
  FROM MainMenu left join SubMenu on  MainMenu.MenuID = SubMenu.MenuID
where SubMenuStatus = 'A'
order by SubMenu.SubMenuName
</CFQUERY>


<tr>
<td colspan="2" ><div id="dolphincontainer">

<div id="dolphinnav">
<ul>
<cfloop query = "DispMainMenu"> 
  <li><cfoutput><a href="#MainMenuURL#" rel="#RelIDMainMenu#"><span>#MainMenuName#</span></a></cfoutput></li>
</cfloop>
</ul>
</div>


<div id="dolphin_inner">
<cfloop query = "DispSubMenu">
<div id="<cfoutput>#DispSubMenu.DivID#</cfoutput>" class="innercontent"> 
<table>
 <tr>
   <td>&nbsp;</td>
 </tr>
 <tr>
  <cfif DispMainMenu.MenuID neq "1">
    <td style="border-right: 1px solid #adc0d1;border-top: 1px solid #adc0d1;border-left:1px solid #adc0d1;border-bottom: 1px solid #adc0d1;width:150px;height:30px;" background="images/bg.gif">
       <a href="#" style="color: #000000" onMouseOver="this.style.color='#93b38e'" onMouseOut="this.style.color='#000000'"><cfoutput>#DispSubMenu.SubMenuName#</cfoutput></a>
    </td>
  </cfif>
 </tr>
</table>
</div>
</cfloop>


</td>
</tr>

Open in new window

Avatar of cfEngineers
cfEngineers

look at the previous post, i gave you a drop-in solution that will loop every 5 rows and give you another <tr>

<table>
	<cfloop query="DispSubMenu">
		<cfif DispSubMenu.currentrow mod 5 or DispSubMenu.currentrow eq 1><tr></cfif>
        	<td style="border-right: 1px solid #adc0d1;border-top: 1px solid #adc0d1;border-left:1px solid #adc0d1;border-bottom: 1px solid #adc0d1;width:150px;height:30px;" background="images/bg.gif">
            	<a href="#" style="color: #000000" onMouseOver="this.style.color='#93b38e'" onMouseOut="this.style.color='#000000'"><cfoutput>#DispSubMenu.SubMenuName#</cfoutput></a>
			</td>	
		<cfif currentrow mod 5 or DispSubMenu.currentrow eq DispSubMenu.recordcount></tr></cfif>
    </cfloop>
</table>

Open in new window

Avatar of lulu50

ASKER

cfEngineers:

I tried it but it displayed all my records name horizontal like this.

Antiques  
Any Real Estate  
Building Lot  
Co-op Unit  
Condominium Unit  
Duplex  
Farm  
Housing swap  
Mobile/Manufactured Home  
Multi-Family Home  
Offie/Commercial  
Parking/Storage  
Raw Land  
Rooms/Shared  
Row House  
Single Family Home  
Sublets/Temporary  
Townhouse/Townhome  
Vacation Rentals  
Vacation swap  

but what I want is something like this.

Antiques   Any Real Estate  Building Lot  Co-op Unit  Condominium Unit  
Duplex  Farm  Housing swap  Mobile/Manufactured Home  Multi-Family Home  
Offie/Commercial  Parking/Storage  Raw Land  Rooms/Shared  Row House  
Single Family Home  Sublets/Temporary  Townhouse/Townhome  Vacation Rentals  Vacation swap  
Avatar of lulu50

ASKER

<tr>
<td colspan="2" >
<div id="dolphincontainer">
<div id="dolphinnav">
<ul>
<cfloop query = "DispMainMenu">
  <li><cfoutput><a href="#MainMenuURL#" rel="#RelIDMainMenu#"><span>#MainMenuName#</span></a></cfoutput></li>
</cfloop>
</ul>
</div>
<cfloop query = "DispMainMenu">
<CFQUERY DATASOURCE="xx" NAME="DispSubMenu" cachedwithin="#createTimeSpan(0,0,0,-1)#">
 SELECT MainMenu.MenuID,SubMenuName,SubMenuURL,DivID
   FROM MainMenu left join SubMenu on  MainMenu.MenuID = SubMenu.MenuID
 where SubMenuStatus = 'A'
 and   MainMenu.MenuID = #val(DispMainMenu.menuID)#
 order by SubMenu.SubMenuName
</CFQUERY>

<div id="Div1">
   <div id="<cfoutput>#RelIDMainMenu#</cfoutput>" class="innercontent">
    <table>
    <cfloop query="DispSubMenu">
            <cfif DispSubMenu.currentrow mod 5 or DispSubMenu.currentrow eq 1><tr></cfif>
              <td style="border-right: 1px solid #adc0d1;border-top: 1px solid #adc0d1;border-left:1px solid #adc0d1;border-bottom: 1px solid #adc0d1;width:150px;height:30px;" background="images/bg.gif">
                  <a href="#" style="color: #000000" onMouseOver="this.style.color='#93b38e'" onMouseOut="this.style.color='#000000'"><cfoutput>#DispSubMenu.SubMenuName#</cfoutput></a>
                  </td>      
            <cfif currentrow mod 5 or DispSubMenu.currentrow eq DispSubMenu.recordcount></tr></cfif>
    </cfloop>
    </table>
  </div>
</div>
</cfloop>
</td>
</tr>
OK I am heading home, I will take a look at it later to see if I can conjure up something.
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lulu50

ASKER

Thank you