frontend form shortcode to exclude certain custom fields

Support MB Frontend Submission frontend form shortcode to exclude certain custom fieldsResolved

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #30949
    dpdp
    Participant

    Is 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 fields

    #30961
    Long NguyenLong Nguyen
    Moderator

    Hi,

    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/

    #30982
    dpdp
    Participant

    just 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"]

    #30990
    Long NguyenLong Nguyen
    Moderator

    Hi,

    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-attributes

    #30991
    dpdp
    Participant

    nice 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.

    #30992
    dpdp
    Participant

    the reason for above - the shortcodes can be placed in templates/scopes where the different customized conditions are already set by builders like oxygen, etc

    #30995
    Long NguyenLong Nguyen
    Moderator

    Hi,

    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.

    #46196
    Anh TranAnh Tran
    Keymaster

    Hi guys,

    This feature was implemented in the plugin. Please follow the docs on using it.

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