Results 1 to 3 of 3

Thread: [solved] Question on Conditionals: FIND_IN_SET()

  1. #1
    User
    Join Date
    07-01-09.
    Posts
    91

    Default [solved] Question on Conditionals: FIND_IN_SET()

    When displaying a list module, you can enter a conditional to filter out items. I've used it successfully against a select field, however I'm having trouble with a tag field and multiple selections.

    The situation is this: I have a tag field that points to a specific section of the Taxonomy tree. The selections I can choose are Professional, Consumer, and Accessory. These are 34, 35, and 36 if your looking at the Tag ID. Since an Item can be both a Professional AND Consumer Item, I needed to be able to select both, thus the use of Tags.

    Now, I have a list module on my Consumer page with a Conditional.
    Code:
    product_class=34
    This will show anything tagged with Consumer just fine.

    Now, on my Professional Page,

    Code:
    product_class=35
    This will show any item tagged ONLY as professional, but NOT items tagged both Consumer AND Professional.


    The question is, how would I word the conditional so that it would show the items tagged with multiple classes?

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Question on Conditionals

    There is an example in the forums and tutorials, you have to use FIND_IN_SET(field, '35,34')>0

  3. #3
    User
    Join Date
    07-01-09.
    Posts
    91

    Default Re: Question on Conditionals

    Ahh, thank you.
    Code:
    FIND_IN_SET(35,product_class)>0
    this ended being the query that did the trick.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •