Forums Forums Search & Filter Pro Strategy for multi-value Post Meta field

Viewing 9 posts - 1 through 9 (of 9 total)
  • Anonymous
    #122987

    I’m trying to figure out the best strategy for filtering some post meta. They were originally setup with a comma separated value inside one field but that isn’t going to work with Search&Filter plugin. My example is days of the week which is great if all were a single day but I have some values such as the following:

    monday, friday
    monday, tuesday, wednesday

    I’m hoping the drop menu will only list out the individual days [Sa, Su, Mo, Tu, We, Th, Fri] in the drop menu. Is categories or a custom taxonomy the only multi-value option I could use to set multiple days?

    Can preview how it’s working here at the top in the first drop-menu:

    http://nmfma.identifiedmedia.com/?page_id=811

    Trevor
    #123083

    If you use ACF (the free Advanced Custom Fields plugin), we support that, and it allows multi choice fields, but the data structure is a WordPress type array (WordPress does not use csv data storage) stored in a single MySQL field.

    Anonymous
    #123414

    The fields aren’t created by ACF but I installed ACF and I can create a new Field Group via ACF. I didn’t see any ACF related info. in the documentation pages. Where can I find out more about integrating with an ACF field group? Thanks!

    Trevor
    #123468

    You don’t integrate with a field group as such, hence it isn’t in the documentation.

    An ACF field group, in its settings is attached to one or more post types. That makes its fields show on the post editor page.

    In the field group you must make a field that has a data type that allows multiple entries. Beware of naming the field/meta key. The ‘name’ (as ACF calls it, but in reality is its slug name or meta key) must NOT be the same as one you have used before. ACF also has a field label, not to be confused with the name.

    When ACF saves each field, it gives them 3 meta keys. Let’s say your field has a ‘name’ of country, then ACF will give it these 3 meta key names – use only the first one when making the S&F form, the other two are used by ACF to link data. I have used xxx’s where ACF will add a random string:

    country
    _country
    field_xxxxxxxxxx

    Anonymous
    #123803

    For some reason, I’m only able to spot the field_xxxxxxxx in S&F and not the field name. Here’s a view of the settings. I selected the Field Groups in the search for post types. Is there a particular field type that I need to use in ACF? I tried Relationship & Post Object.


    Trevor
    #123809
    This reply has been marked as private.
    Anonymous
    #123815
    This reply has been marked as private.
    Trevor
    #123830

    Hi

    Both search forms search the CPT Store Locator, but the field group is attached to posts, not that Store Locator CPT.

    Also, you might need to have some data in those Store Locator posts in that field.

    Anonymous
    #125354

    Thanks, this was sorted out. I ended up just using the categories using the excluded feature to separate out the two types of categories.

Viewing 9 posts - 1 through 9 (of 9 total)