frontend form shortcode to exclude certain custom fields
Support › MB Frontend Submission › frontend form shortcode to exclude certain custom fieldsResolved
- This topic has 7 replies, 3 voices, and was last updated 1 year, 2 months ago by
Anh Tran.
-
AuthorPosts
-
September 25, 2021 at 6:45 PM #30949
dp
ParticipantIs there anyway to exclude certain custom fields (NOT the docs default fields [title, content, excerpt, date, thumbnail]) from the frontend form shortcode ([mb_frontend_form id="meta-box-id"])?
eg.
Page A requires a form with 8 custom fields
Page B requires a form with only 5 of the same custom fields as above
Page C requires 3 of the same custom fieldsSeptember 26, 2021 at 3:33 PM #30961Long Nguyen
ModeratorHi,
You can use the extension MB Conditional Logic to show/hide a field based on the page ID. Please read more on the documentation https://docs.metabox.io/extensions/meta-box-conditional-logic/
September 26, 2021 at 9:24 PM #30982dp
Participantjust tested but i realize that's done in the frontend to hide the fields (which can still be edited). What i actually meant is to exclude the specified custom fields from the backend, rather than hide using jquery and css
eg. ref -> like [mb_frontend_form id="meta-box-id"] has post_title and post_content omitted from the bkend [mb_frontend_form id="meta-box-id" post-fields="title,content"]
September 27, 2021 at 9:25 AM #30990Long Nguyen
ModeratorHi,
The extension MB Include Exclude helps you to include/exclude the meta boxes but it does not work with the custom fields. So you can create more meta boxes, assign them to one post type and show them on the frontend via shortcode ID by adding commas. For example:
[mb_frontend_form id="meta-box-id1,meta-box-id2,meta-box-id3"]Get more details on the documentation
https://docs.metabox.io/extensions/meta-box-include-exclude/
https://docs.metabox.io/extensions/mb-frontend-submission/#shortcode-attributesSeptember 27, 2021 at 10:33 AM #30991dp
Participantnice but that would involve creating more forms, which can be hard to manage. Would ur development team consider something like this.. for a better UX management? Just suggesting, hope u dun mind or what're ur thoughts?
eg. form with 10 custom fields - [mb_frontend_form id='advice-form']
- form [mb_frontend_form id='advice-form' fields='-cf1,-cf3'] to dynamically display 8 custom fields,
- another form [mb_frontend_form id='advice-form' fields='-cf8,-cf9,-cf0'] to dynamically display 7.September 27, 2021 at 10:43 AM #30992dp
Participantthe reason for above - the shortcodes can be placed in templates/scopes where the different customized conditions are already set by builders like oxygen, etc
September 27, 2021 at 12:49 PM #30995Long Nguyen
ModeratorHi,
Thank you for your feedback.
I'm going to inform the developer team to consider adding this feature to the to-do list for the future development of the plugin.
August 22, 2024 at 8:30 AM #46196 -
AuthorPosts
- You must be logged in to reply to this topic.