Skip to main content

How to Use the Field Updater Addon

Updated over 8 months ago

The Field Updater Addon lets you dynamically update your form fields and display related content on your website. In this guide, we’ll walk you through three popular use cases:

  • Displaying Related Posts

  • Displaying Related Categories

  • Displaying Posts from a Selected Category

For all these use cases, make sure you have installed the addon from the GitHub repository:


1. How to Display Related Posts

This example shows you how to display posts related to a selected custom post type (CPT) item.

Steps:

  1. Install the Addon

  2. Create a Posts Query for Your CPT

    • Set up a Query for your CPT where you want to display related posts.

    • Select the appropriate macros for your related items.

    • Note: The query variable should be named jfb_update_related_select (replace select with the name of your first Select form field).

  3. Create a Dynamic Select Field

    • In your form, add a new Select field and choose the new query you just created.

    • Enable the Generate Dynamically option.

    • Below, select Get values list from JetEngine Query.

    • Replace the number (e.g., 284) in the Field name section with your query ID (find it in the URL of the query).

    • Enable the Field Updater option and enter the first select form field’s name in the Fields to Listen section.


2. How to Display Related Categories

This example explains how to dynamically display child categories based on a selected parent category.

Steps:

  1. Download and Install the Field Updater Addon.

  2. Create a Query for the Parent Category

    • Create a Terms Query that lists the parent categories.

  3. Add a Select Field for Parent Categories

    • In your form, add a select field that uses the parent category query.

    • In this setup, the query ID (e.g., 140) is visible in the URL, and the query returns values where term_id is the value and name is the label.

  4. Create a Query for the Child Category

    • In the General tab of your new query, select your taxonomy.

    • In order to display child terms use Child of option with dynamic tag JFB Update Field - Form Field Value and insert parent field name.

  5. Add a Select Field for Child Categories

    • Create another form field that uses the child category query.

    • Enable the Field Updater option and enter the parent field’s name (from the form) in the Fields to Listen section.


3. How to Display Posts from a Selected Category

This example demonstrates how to list posts that belong to a selected category using the Field Updater Addon.

Steps:

  1. Install the Addon

  2. Create a Terms Query for the Category

    • Create terms query that fetches the terms for your desired category.

  3. Add a Select Field for Categories

    • Add a select field in your form using the query from Step 2.

    • In this field, the query ID (e.g., 260) will be used, and the query returns term_id as the value and name as the label.

  4. Create a CPT Query for Your Posts

    • Create posts query to list posts from your selected category.

    • In the Terms section of the query, select the Form Field Value macro and enter the form field name that holds your category terms.

  5. Add a Select Field for the Posts

    • Create another select field that uses the results of the CPT query.

    • Ensure you use the proper query ID and that the field returns the value and label as required.

    • Enable the Field Updater option and enter the name of the form field with terms in the Fields to Listen section.


Additional Information

For more details and advanced configurations, please check out the following resources:

Did this answer your question?