Hi John,

There is no DB. The titles are being push to the page through a template
control file from our CMS. All I need to do is sort them alphabetically
on the page.

Steve LaBadie, Web Manager
East Stroudsburg University
200 Prospect St.
East Stroudsburg, Pa 18301
570-422-3999
http://www.esu.edu
[email protected]
-----Original Message-----
From: John M Bliss [mailto:[email protected]] 
Sent: Tuesday, August 25, 2009 8:41 AM
To: cf-talk
Subject: Re: Alphabetical Sort List


Best is probably a query.  For example:

<cfset myQuery = QueryNew("letter,title")>
<cfset QueryAddRow(myQuery)>
<cfset QuerySetCell(myQuery, "letter", "A")>
<cfset QuerySetCell(myQuery, "title", "Title")>
<cfset QueryAddRow(myQuery)>
<cfset QuerySetCell(myQuery, "letter", "A")>
<cfset QuerySetCell(myQuery, "title", "Title")>
<cfset QueryAddRow(myQuery)>
<cfset QuerySetCell(myQuery, "letter", "B")>
<cfset QuerySetCell(myQuery, "title", "Title")>
<cfset QueryAddRow(myQuery)>
<cfset QuerySetCell(myQuery, "letter", "B")>
<cfset QuerySetCell(myQuery, "title", "Title")>
<cfset QueryAddRow(myQuery)>
<cfset QuerySetCell(myQuery, "letter", "C")>
<cfset QuerySetCell(myQuery, "title", "Title")>
<cfset QueryAddRow(myQuery)>
<cfset QuerySetCell(myQuery, "letter", "C")>
<cfset QuerySetCell(myQuery, "title", "Title")>

...or from the DB.  This will allow you to do this:

<ul>
<cfoutput group="letter" query="myQuery">
<li>#myQuery.letter#</li>
<ul>
<cfoutput>
<li>#myQuery.title#</li>
</cfoutput>
</ul>
</cfoutput>
</ul>

On Tue, Aug 25, 2009 at 7:27 AM, Steve LaBadie
<[email protected]>wrote:

>
> I want to sort a group of titles alphabetically and separate them into
> Alpha groups.
>
>
>
> A
>
>                Title
>
>                Title
>
>
>
> B
>
>                Title
>
>                Title
>
> C....
>
>
>
> I came across ArraySort but not sure if I can specify a single letter
of
> the alphabet for my example above. Any guidance would be appreciated.
>
>
>
> A
>
> <cfset ArraySort(aAArray,"textnocase")>
>
> <cfoutput>
>
>  <cfloop from="1" to="#ArrayLen(aAArray)#" index="i">
>
>   #aAArray[i]#<br/>
>
>  </cfloop>
>
> </cfoutput>
>
>
>
> B
>
> <cfset ArraySort(bBArray,"textnocase")>
>
> <cfoutput>
>
>  <cfloop from="1" to="#ArrayLen(bBArray)#" index="i">
>
>   #bBArray[i]#<br/>
>
>  </cfloop>
>
> </cfoutput>
>
>
>
> C....
>
>
>
> Steve LaBadie, Web Manager
>
> East Stroudsburg University
>
> 200 Prospect St.
>
> East Stroudsburg, Pa 18301
>
> 570-422-3999
>
> http://www.esu.edu <http://www.esu.edu>
>
> [email protected] <mailto:[email protected]>
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325665
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to