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.

Any way to show entries that share 2 or more categories?

August 15, 2007 7:57pm

Subscribe [2]
  • #1 / Aug 15, 2007 7:57pm

    adam11238

    34 posts

    I’m building a directory of galleries and museums in NYC, and each gallery is categorized by neighborhood and type. Is there any way, once someone has clicked on a neighborhood, to then have the option to click on a gallery type and only show the results within that neighborhood? Or vice versa?

  • #2 / Aug 15, 2007 10:24pm

    Sue Crocker

    26054 posts

    So is the gallery type a subcategory of neighborhood?

  • #3 / Aug 15, 2007 10:43pm

    adam11238

    34 posts

    Nope. Here’s the site: http://nycgallerydirectory.com

    Each neighborhood is a sub-category of a borough, but the gallery types are their own categories. I think what I’m basically looking for is a way to show galleries that have 2 or more categories in common—i.e. all galleries in “Midtown” and “Contemporary”. I was thinking that there might be a way to do it with the 3rd segment once you are in a specific category. Something like clicking on the gallery type while viewing galleries in Midtown would show all galleries in category=”{segment_3}|{2nd_category}”, but I couldn’t follow the idea through.

  • #4 / Aug 15, 2007 10:59pm

    Daniel Walton

    553 posts

    You would have to construct the parameter like so for this to work:

    category="{segment_3}&{segment_4}"

    Then you would just have to work out how to get those category ID’s into the URL segments 3 and 4.

    You might need to use a little php on the template to construct the links correctly, but it should all be fairly straight forward.

  • #5 / Aug 15, 2007 11:12pm

    Sue Crocker

    26054 posts

    Thanks for the assist, the_butcher.

    adam11238, does the advice from the_butcher make sense?

  • #6 / Aug 15, 2007 11:24pm

    adam11238

    34 posts

    i think so. let me give it a shot, and i’ll come back with any questions. thanks for the replies.

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

ExpressionEngine News!

#eecms, #events, #releases