Using MB on pages, not posts
- This topic has 4 replies, 2 voices, and was last updated 5 years ago by
@mindspark.
-
AuthorPosts
-
May 26, 2020 at 11:14 PM #19845
@mindspark
ParticipantHi -
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 websiteDetails:
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.
May 27, 2020 at 9:57 AM #19852Long Nguyen
ModeratorHi,
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/.
May 27, 2020 at 11:47 PM #19859@mindspark
ParticipantI 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.
May 28, 2020 at 10:32 AM #19870Long Nguyen
ModeratorHi,
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/May 13, 2021 at 7:30 PM #28163@mindspark
Participantthank you Long!
-
AuthorPosts
- You must be logged in to reply to this topic.