cfloops

Reply

Join Date: Mar 2008
Posts: 2
Reputation: mollypepperpot is an unknown quantity at this point 
Solved Threads: 0
mollypepperpot mollypepperpot is offline Offline
Newbie Poster

cfloops

 
0
  #1
Mar 15th, 2008
I'm trying to make a list of sub titles that links to mid topic jumps on another page. As the sub titlles are the same for each main title and the midtopic jumps increment numerically- I thought I could use cfloop - but I can't get it to work - either my titles all have to be the same or my links all have to be the same.... can anyone help??
I tried using nested loops but that made it worse as the inner loop had to loop through before the outer loop ... hope that makes sense!!! Can someone help me??

As you may have guessed - I'm a noobie so I would be grateful for any suggestions
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 72
Reputation: cmhampton is an unknown quantity at this point 
Solved Threads: 10
cmhampton's Avatar
cmhampton cmhampton is offline Offline
Junior Poster in Training

Re: cfloops

 
0
  #2
Mar 18th, 2008
Are you outputting from a query?

If so you can use the group attribute of the cfoutput tag. Here's an example:

  1. <cfoutput query="queryname" group="title">
  2. #Title#
  3. <cfoutput>
  4. #SubTitle#<br />
  5. </cfoutput>
  6. </cfoutput>

This would ouput the following:

Title1
Subtitle1
Subtitle2
Subtitle3
Title2
Subtitle1
Subtitle2
Title3
Subtitle1

Post some of your code and I'll have a look at it.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 2
Reputation: mollypepperpot is an unknown quantity at this point 
Solved Threads: 0
mollypepperpot mollypepperpot is offline Offline
Newbie Poster

Re: cfloops

 
0
  #3
Mar 18th, 2008
Thanks this was really helpful, I got so bogged down with cflooping that I didn't think to try looking at it differently!!!
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 72
Reputation: cmhampton is an unknown quantity at this point 
Solved Threads: 10
cmhampton's Avatar
cmhampton cmhampton is offline Offline
Junior Poster in Training

Re: cfloops

 
0
  #4
Mar 18th, 2008
Glad to help. Let me know if you have any other questions.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the ColdFusion Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC