[wp-hackers] Best approach

Jeremy Clarke jer at simianuprising.com
Tue Sep 27 15:06:03 UTC 2011


On Mon, Sep 19, 2011 at 2:34 PM, Diana K. Cury <dianakac at gmail.com> wrote:

>
> I'm think taxonomies should do, but is ok to add soo much items like
> cities? Is there limit?!
>
>
There's no technical limit but there are usability issues that come up with
hierarchical (category-style) taxonomies if you have too many terms in them.
Specifically the category selection box is really intended for 2-100 or so
terms, more than that and it is no longer a good interface to deal with such
a long list. If the terms are actually in a complex hierarchy more than 2
levels deep it gets even worse because it's almost impossible to visualize
the hierarchy in that tiny box. I've also found (in having categories hold
world regions then countries inside them) that trying to display complex
taxonomy hierarchies on the frontend can be a big hassle and definitely
requires reworking the standard taxonomy display functions because e.g. you
don't want a list of all terms sorted alphabetically if some of them are
cities and some of them are countries, you want to show the hierarchy
somehow.

That said, any situation where you want to functionally relate
countries/states/cities together is going to be very complicated, so putting
the work into a hierarchical taxonomy solution is probably your best bet.


> I found quite easy to populate the terms using insert_terms, but there is
> someway to insert taxonomies within a prent one?!
>
>
When you insert terms you can add the 'parent' field with the term_id of the
parent you want to set. Look at the function to see how that's possible, I
may have the detail wrong but that's the essence.

-- 
Jeremy Clarke • jeremyclarke.org
Code and Design • globalvoicesonline.org


More information about the wp-hackers mailing list