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.

question about categories, category groups, and dynamic parameters

March 20, 2012 8:37pm

Subscribe [3]
  • #1 / Mar 20, 2012 8:37pm

    gkboyer

    13 posts

    I’m having some trouble wrapping my head around this one - it seems like I should be able to do it without js or php, but I can’t quite wrap my head around it:

    I have a number of articles in a channel. Each article can be assigned multiple categories from 2 different category groups, like:

    Age: Child, Teen, Adult, Retired
    Topic: Bikes, Cheese, Books, Games

    Using an online form, the user selects one or more category values from one or both category groups. When the user submits the form, EE uses dynamic parameters to determine the appropriate categories and display all articles that match any of those criteria.

    So far, so good, BUT: I need EE to do a boolean “or” match WITHIN each category group, but a boolean “and” search BETWEEN the two category groups. Currently, if a user selects “Teen” from the Age group, and “Bikes” and “Cheese” from the Topic group, EE is doing an “or” search both within and between the categories, so in this example, any article that pertains to Bikes or Cheese will appear, regardless of whether it’s appropriate for Teens, and likewise any article marked “Teen” will also appear, even if it doesn’t talk about Bikes or Cheese.

    Instead, what I need is for EE to display ONLY those articles that match both the categories in the Topic Group (bikes or cheese) AND that are also categorized for “Teen”

    Any ideas/suggestions for how I might accomplish this will be greatly appreciated!

  • #2 / Mar 20, 2012 11:31pm

    Enviromed

    375 posts

    Using tags - and there are several terrific tag addons at Devot-ee.  We use and solspace.com Tags. it is potentially be much simpler, more flexible, more intuitive and user friendly.

  • #3 / Mar 21, 2012 9:08pm

    gkboyer

    13 posts

    Hmm…I was thinking tags might be too freewheeling for my purposes here, but maybe I should rethink that. Certainly a lot easier to implement…

    Thanks!

  • #4 / Mar 25, 2012 9:26pm

    Boyink!

    5011 posts

    Doable with categories, but not simple as they are intended to be (for the most part) simple filters.

    Here’s an approach I worked out:

    http://www.train-ee.com/courseware/free-tutorials/comments/simple-multifaceted-navigation-using-categories/

  • #5 / Mar 26, 2012 12:48pm

    gkboyer

    13 posts

    Cool! I will give this a try.

    Thanks,

    Gayle

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

ExpressionEngine News!

#eecms, #events, #releases