Results 1 to 9 of 9

Thread: Filtering

  1. #1
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default Filtering

    Dear Contaoers

    Catalog is a powerful tool but is quite difficult to domesticate…
    I need some explanation about the filter module. I hope that some expert will help me.

    I have a Product catalog and I categorize the products with a category field. I use the same catalog to display on various pages different kinds of products: one page for shirts, one for trousers, one for shoes. For this I apply a condition in the lister as this: category=1 ,…

    My problem occurs when I add a catalog filter on the same page. Let’s imagine that on that page I only want to see category 4,6,8. Putting this condition in the lister works fine and I have a long list of products (for example: moccasins, boots, sandals).
    Now I set up the catalog filter, define the category as a combo box. On the page appears the combo box and the listing still the same (that’s fine).

    BUT…
    in the combo box appears all the category of my product Catalog and not only category 4,6,8 as defined in the condition of the lister (I see: shirts, moccasins, boots, sandals, trousers, and I don't want to see shirts and trousers).
    So I went back to the back office and I noticed the field “Use filter condition from lister on same page.” I checked it. But in the front end the combo disappears and I only have the link “clear all filter”.

    The question is: how to proceed to have the combo box displaying only the category corresponding to the lister?

    Thank’s for your help
    And I wish you all a happy new year.
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

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

    Default Re: Filtering

    I've run into this as well. There seems to be a disconnect between the Condition and the initial state of the Filter box. The work around for me was to link to a filtered state. So, for your situation, you would use the filter to show only the items you want, copy that URL and that would be your initial link to that page.

    In my case, I have products that are Active and Discontinued, and in one page I only want active items to show. If I use a condition of showing active only, my drop-down model filter still shows discontinued items. However, If I link to the catalog page in a filtered state (ex. /product-catalog/product_status/active) then the drop-down will ONLY show Active items. Make sense?

    It's not ideal, but it does work. The other drawback is you will need to modify the "Clear Filter" link to link to the "pre-filtered" page since it will default to removing all filters.

  3. #3
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default Re: Filtering

    I don't understand the
    If I link to the catalog page in a filtered state
    How you do it ?

    For the moment I have found a solution which is from my point of view not the better but works:
    I have split the category to category / subcategory and I apply the filter to the subcategory.
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

  4. #4
    User
    Join Date
    01-29-13.
    Posts
    64

    Default Re: Filtering

    Hello to everybody,
    I read this topic while searching to a solution to an almost identical issue, so I thought it would have been a good idea to "resuscitate" the topic since a workaround was apparently found, but not a definitive solution.

    I want, as evantro did, to filter my items using a list/filter combo. The list already does not show the records with the deleted field set to true, therefore I see just a subset of records, but this does not stop the filter to show all the items, even those which are not shown in the below lista at all.

    I came to know, with this post, that it's a workaroundable issue, but I sincerely didn't get how evantro did solve it with the split into category/subcategory.

    Can please anbybody tell me any hint about it?

    Thank you
    --
    Marco
    ---------
    Triste e' l'uomo
    che ama le cose
    solo quando si allontanano.
    (Baolian, libro dei pensieri Baol, I, vv. 1240-1242)

  5. #5
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default Re: Filtering

    It's a bit far in my memory...

    As far as I remember, at the beginning I was using a personal field in my table, then I changed it to use the Category module, in which you can create sub-categories.

    The with this structure you can apply the filters.
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

  6. #6
    User
    Join Date
    01-29-13.
    Posts
    64

    Default Re: Filtering

    Hi evantro,
    thank you for answering back your old post.
    I'm not sure I got exactly how you managed to apply the workaround. Once you have the subcategories how do you apply the filter to them?

    I'm filtering the items in the list by a field which is a boolean the users check or uncheck in order to delete the records (since catalog does not seem to provide a front-end approach to deletion I had to come up with this). Can I apply anyway your category/subcategory approach?

    Thank you
    --
    Marco
    ---------
    Triste e' l'uomo
    che ama le cose
    solo quando si allontanano.
    (Baolian, libro dei pensieri Baol, I, vv. 1240-1242)

  7. #7
    User
    Join Date
    01-29-13.
    Posts
    64

    Default Re: Filtering

    Hi evantro,
    can't you remember how you managed to do it yet? I'm pretty stuck with this issue, since filtering in modules becomes quite useless if you can't filter in the filter module itself... :cry:
    --
    Marco
    ---------
    Triste e' l'uomo
    che ama le cose
    solo quando si allontanano.
    (Baolian, libro dei pensieri Baol, I, vv. 1240-1242)

  8. #8
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default Re: Filtering

    I did it this way...

    On the taxonomy module I created the structure
    - Product 1
    - sub Prod. 1
    - sub Prod. 2
    - Product 2
    - Product 3

    On the catalog I've got 2 fields : Product value / sub Prod. value

    Product and Sub Prod. are Select Type lists with tl_taxonomy as source, and Sub Pro. is customized with ONLY sub prod. lines checked, Select children mode -> show item selected collapsed Parent category -> Products

    In the article I´ve included the filter module. In the Filter fields enable filters by selection is checked, sub Prod. is set as select dropdown and the other fields are set to none.
    Template setting: filter default / mod_catalog filter

    cheers
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

  9. #9
    User
    Join Date
    01-29-13.
    Posts
    64

    Default Re: Filtering

    Okay, now I get that our situation is pretty different. I don't have any taxonomy field, I just would like to "filter out of the filter" all the items with a specific flag.

    Since it's a different situation I'll open another thread.

    Thank you indeed!
    --
    Marco
    ---------
    Triste e' l'uomo
    che ama le cose
    solo quando si allontanano.
    (Baolian, libro dei pensieri Baol, I, vv. 1240-1242)

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
  •