ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Club listing - best method - related entries or SQL query

November 11, 2008 2:40pm

Subscribe [4]
  • #1 / Nov 11, 2008 2:40pm

    rmeder

    97 posts

    I am creating a club listing where I would like it to be displayed by the following tree structure:
    Region
    -State 1
    —City 1
    —-entry 1
    —-entry 2
    —-etc…

    —City 2
    —-entry 1
    —-entry 2
    —-etc…

    -State 2… and so on.

    What would the best method for handling this be?  Related entries or a custom SQL query?

    Thank you for any input!

    Rick

  • #2 / Nov 11, 2008 3:54pm

    rmeder

    97 posts

    Or should it be done using a combination of categories (region, state) and then related based on city?

  • #3 / Nov 11, 2008 4:30pm

    Ingmar

    29245 posts

    There are numerous ways, of course—personally I’d start out with categories and sub-categories, yes.

  • #4 / Nov 11, 2008 7:47pm

    rmeder

    97 posts

    Would you then go to related entries? 

    So Region and state would be a category and then all entries in the “entry” weblog would be related to a city in the “city” weblog and pulled up by the reverse_related_entries tag.  Does this make sense? 

    I had initially attempted to code it will all related entries until I found out that you can’t nest them.  I like the related entries better because I don’t have to worry about people selecting categories for region, state, city.  They will just select it from a dropdown on the cp form.

  • #5 / Nov 11, 2008 8:54pm

    Versa Studio

    572 posts

    Hi Rich,

    EE is somewhat inflexible in this area. I created an app with similar needs, and by using related weblogs instead of categories, it ended up requiring a ton of custom SQL to get results.

    http://flushotfinder.weatrust.com

    Definitely utilize categories as much as you can before going with related entries.

  • #6 / Nov 11, 2008 10:08pm

    Stephen Lewis

    466 posts

    Definitely utilize categories as much as you can before going with related entries.

    I have to agree with this. I used related entries for much of the “Distributors” section on this site, and ended up with some very fiddly custom SQL that I would prefer to have avoided.

    Stephen

  • #7 / Nov 11, 2008 10:15pm

    rmeder

    97 posts

    I guess I will give it a shot with categories then.  The related entries work perfect if you only have two levels. It is a shame that there isn’t a way to nest reverse_related_entries.  It would make this a much easier task.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases