Using MB on pages, not posts

Support General Using MB on pages, not postsResolved

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #19845
    @mindspark@mindspark
    Participant

    Hi -

    Overview:

    I'm building a WaaS system that collects data from clients via a webform. This data will be dynamically populated in specific areas throughout a website, but not only in posts. I need to display some of the data in pages, not posts.

    Example:

    Data collected: Business Address
    Desired Display Location: Footer for the entire website

    Details:

    I am using Beaver Themer which has an option for both Header and Footer. Since my Footer is not CPT specific, I am wondering how I can display a Business Address collected from a web form and then dynamically update to display in the Footer?

    thanks in advance.

    #19852
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Could you please let me know how you collect the data and save it with the Meta Box fields?

    If you want to show the specific field on the page and other fields on the post, please use the extension MB Conditional Logic.

    'visible' => array( 'post_type', '=', 'page' )

    Then follow this guide to show the field value on the page with Beaver Themer https://metabox.io/introducing-beaver-themer-conditional-logic-integration/.

    #19859
    @mindspark@mindspark
    Participant

    I created a CPT named = "Locations"

    I created a Custom Field Group for "Locations"

    For this inquiry, I manually added Location address info for "Main Office"

    The plan is to create a form using the MB shortcodes created for the custom field group so users can enter the info themselves.

    My question/issue lies in how to display the collected data from the CPT "Locations" inside of a Themer Layout which is not assigned to a specific post. The Themer layout is for the footer of the entire website.

    #19870
    Long NguyenLong Nguyen
    Moderator

    Hi,

    As I understand, you are using MB Frontend Submission to collect the location from the user. Every time the user submits the form, it will create a post location with field value Business Address.

    The footer content is fixed for the entire website, so I think you should use the shortcode to show the field value of a specific location (post type).
    [rwmb_meta id="field_id" object_id="15"]

    For more information, please follow the documentation.
    https://docs.metabox.io/shortcode/

    #28163
    @mindspark@mindspark
    Participant

    thank you Long!

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