Grouping some information.

A place for users and developers of the Xataface to discuss and receive support.

Postby vlad » Thu Aug 02, 2007 10:44 am

I would like to sort cities by the first letter grouping them. Something like this:

Cities starting with letter A:
Anchorage , Abu Dhabi
Cities starting with letter B:
Beverly Hills , Bucharest, Brisbane
Cities starting with letter C:
.... and so on.

This list is now based on the browse_by_cat action from librariandb. The problem is that I have over 15000 cities and it's hard to look for the desired city.

Excuse my english. Thank you.
Vlad
vlad
 
Posts: 28
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri Aug 03, 2007 12:26 pm

I don't see a reason why you can't do this.Ê The browse_by_cat action has the SQL query explicitly inside the PHP for the action.Ê You just need to change the query to produce theÊ results that you want.



e.g . "select ..... where city like 'A%'" ...Ê

And you would probably want to add a little contents to the top to allow you to choose a letter from the alphabet.
-Steve



--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved