• Resolved cperrine

    (@cperrine)


    I’m building a local business directory with one Places CPT. I currently have about 20 main/parent categories and roughly 200 child/subcategories.

    I created category-specific fieldsets using Conditional Fields. For example, Food & Dining has its own fieldset with restaurant-specific fields.

    The issue is that if a user selects only a child category such as Mexican or Breweries, the parent Food & Dining category is not also selected, so the Food & Dining conditional fieldset does not appear.

    I want the user experience to be simple: choose the specific business type, and automatically see the fields associated with its main parent category.

    What is the recommended GeoDirectory setup for this?

    Specifically:

    1. Is there a native setting, hook, or supported method to automatically assign/select a parent category when a child category is selected?
    2. Can Conditional Fields detect that a selected category is a descendant of a parent category, rather than requiring every child category ID to be entered manually?
    3. Is there a supported parent-first / child-second category selector for the Add Listing form?
    4. If not, what is the recommended architecture for a directory with many parent and child categories that also needs category-specific conditional fields?

    I’d like to avoid manually maintaining hundreds of child-category IDs in conditional rules if there is a cleaner supported approach.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Paolo

    (@paoltaia)

    Hi,

    I just tested this and confirm is not working as you hoped. The dev team is looking into it to see if we can find a workaround…

    They’ll update you here ASAP.

    Thanks for your patience.

    Plugin Author Paolo

    (@paoltaia)

    My bad, after checking with the developers, they corrected my first assumption and explained how it really works and that there is nothing to fix:

    Conditional fields for dropdown fields are matched with option values. The category fields use IDs as option values. Please use the category ID instead of the category name in the condition field match value. Example: Attractions has category ID 77 Hotels has category ID 89 Videos has category ID 93 Match rule should be like: For a single category : show if Category equals 77 For multiple categories: show if Category contains 77,89,93

    Basically you need to add the ID for the main and sub-categories on each condition.

    Let me know how it goes and if you have any further questions.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.