Filter POST field items using other POST field

Support MB Builder Filter POST field items using other POST fieldResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4832
    Josué E. PizanoJosué E. Pizano
    Participant

    Hi! I have a problem with a MetaBoxes that using multiple POST type fields.

    I have 4 post types for the different structures existed in Mexican Law (Leyes, Títulos, Capítulos and Artículos). I have created a meta box for each one.

    In "Capítulos", for example, I have two Post fields (one for Leyes [to select the law on witch it depends] and other one for "Título" [to select the fraction of the law where this "Capítulo" is located]).

    The problem is generated because I need to filter to display only the "Títulos" that is registered under the law I selected on the prior field. The logical order for my user is:

    1. Select the law
    2. Select the title
    3. Select the chapter

    Note: I'm not using categories because this site require to create a lot of posts of each type and is really difficult for the end user to manage so many nested categories.

    Regards!

    #4835
    Tan NguyenTan Nguyen
    Participant

    Dear Josue,

    Please try MB Conditional Logic:

    https://metabox.io/docs/meta-box-conditional-logic/

    Then in your Post field, you can visible when post_type = Títulos

    Best regards,

    Tan

    #4837
    Josué E. PizanoJosué E. Pizano
    Participant

    Hi, Tan!

    I understood, but is not just showing or hiding the input, I need to filter the items available in the second field according to the previous post field. For example: There is many "Titulos" related to different Laws, but if my user selects the "Constitución Política" item, I need to show only those "Títulos" where there is that law selected... like an SQL join.

    Regards!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.