Forum Replies Created
-
AuthorPosts
-
February 15, 2021 at 5:21 PM in reply to: ✅Frontend Submission to a static page like home page #24457
[email protected]
ParticipantHi Long,
Thanks for the reply. I have changed the conditional logic. Now the fields are showing on the frontend. But if, I edit the field values and click submit, a success message is displayed, but the values are not changes in the database. So, it is a bit confusing, maybe I am doing something wrong.
But since I am short of time to complete the project. So, for the time being I have purchased the Livecanvas plugin, which is very easy and user-friendly for the clients, to edit the static pages on the frontend. So, I will give Metabox frontend submission a try in future and will get back to you, if needed.February 15, 2021 at 1:35 AM in reply to: ✅Frontend Submission to a static page like home page #24450[email protected]
ParticipantHi Long,
Thanks for Reply. Actually on front end only the page title and the default WP Editor are available for data editing and submission. But no custom fields are displaying on the frontend submission Form. Kindly see the screencast. https://d.pr/v/Tm4eN1[email protected]
ParticipantIt is a sort of case study request, if possible.
Kindly create a guide containing simple examples on various custom fields and how to display those in MB Views. It will be very helpful, to cut the time, which is wasted in searching various online sources to do simple things, but unfortunately, there are very minimal tutorials/resources, when it comes to Metabox, as compared to ACF, Toolset and Jetengine.[email protected]
ParticipantOkay Thanks.
Yes, PHP function with proxy mb. is a good idea. I will try it, and will contact, in case I requre further help.
Thanks once again.[email protected]
ParticipantThanks, that worked.
Kindly also advise, on how to display the image in twig, like in the above example, there is one custom field with ID event_speaker_image. How to display that?Further, is it possible, to write simple PHP instead of twig in the views? I tried to write PHP code, but the output is the code itself and not the result.
I have found a cookbook regarding functionality of twig with customfields, but it is more focused on ACF, so not much of help.
https://timber.github.io/docs/guides/acf-cookbook/[email protected]
ParticipantHi Long,
I tried but not able to display. I am somewhat familiar with PHP and but not with Twig.
So for the time being, I will use Advanced Custom Fields for my template. But I will surely give MB Views a try, when there will be a detailed documentation with a simple example on using and displaying Custom Post Types with MetaBoxes (custom fields)in the MB Views for example on Home Page.[email protected]
Participant//Here is the Code For Events CPT
add_action( 'init', 'your_prefix_register_post_type' ); function your_prefix_register_post_type() { $labels = [ 'name' => esc_html__( 'Events', 'your-textdomain' ), 'singular_name' => esc_html__( 'Event', 'your-textdomain' ), 'add_new' => esc_html__( 'Add New Event', 'your-textdomain' ), 'add_new_item' => esc_html__( 'Add new event', 'your-textdomain' ), 'edit_item' => esc_html__( 'Edit Event', 'your-textdomain' ), 'new_item' => esc_html__( 'New Event', 'your-textdomain' ), 'view_item' => esc_html__( 'View Event', 'your-textdomain' ), 'view_items' => esc_html__( 'View Events', 'your-textdomain' ), 'search_items' => esc_html__( 'Search Events', 'your-textdomain' ), 'not_found' => esc_html__( 'No events found', 'your-textdomain' ), 'not_found_in_trash' => esc_html__( 'No events found in Trash', 'your-textdomain' ), 'parent_item_colon' => esc_html__( 'Parent Event:', 'your-textdomain' ), 'all_items' => esc_html__( 'All Events', 'your-textdomain' ), 'archives' => esc_html__( 'Event Archives', 'your-textdomain' ), 'attributes' => esc_html__( 'Event Attributes', 'your-textdomain' ), 'insert_into_item' => esc_html__( 'Insert into event', 'your-textdomain' ), 'uploaded_to_this_item' => esc_html__( 'Uploaded to this event', 'your-textdomain' ), 'featured_image' => esc_html__( 'Featured image', 'your-textdomain' ), 'set_featured_image' => esc_html__( 'Set featured image', 'your-textdomain' ), 'remove_featured_image' => esc_html__( 'Remove featured image', 'your-textdomain' ), 'use_featured_image' => esc_html__( 'Use as featured image', 'your-textdomain' ), 'menu_name' => esc_html__( 'Events', 'your-textdomain' ), 'filter_items_list' => esc_html__( 'Filter events list', 'your-textdomain' ), 'items_list_navigation' => esc_html__( 'Events list navigation', 'your-textdomain' ), 'items_list' => esc_html__( 'Events list', 'your-textdomain' ), 'item_published' => esc_html__( 'Event published', 'your-textdomain' ), 'item_published_privately' => esc_html__( 'Event published privately', 'your-textdomain' ), 'item_reverted_to_draft' => esc_html__( 'Event reverted to draft', 'your-textdomain' ), 'item_scheduled' => esc_html__( 'Event scheduled', 'your-textdomain' ), 'item_updated' => esc_html__( 'Event updated', 'your-textdomain' ), 'text_domain' => esc_html__( 'your-textdomain', 'your-textdomain' ), ]; $args = [ 'label' => esc_html__( 'Events', 'your-textdomain' ), 'labels' => $labels, 'description' => '', 'public' => true, 'hierarchical' => false, 'exclude_from_search' => false, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'show_in_rest' => true, 'menu_position' => 2, 'query_var' => true, 'can_export' => true, 'delete_with_user' => true, 'has_archive' => true, 'rest_base' => '', 'show_in_menu' => true, 'menu_icon' => 'dashicons-admin-users', 'capability_type' => 'post', 'supports' => ['title', 'editor', 'thumbnail'], 'taxonomies' => [], 'rewrite' => [ 'with_front' => false, ], ]; register_post_type( 'event', $args ); }//Here is the Code for MetaBoxes attached to Events CPT
add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' ); function your_prefix_register_meta_boxes( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => esc_html__( 'Event Fields Group', 'text-domain' ), 'id' => 'event_fields_group', 'post_types' => ['event'], 'context' => 'normal', 'priority' => 'high', 'fields' => [ [ 'id' => $prefix . 'event_date', 'type' => 'date', 'name' => esc_html__( 'Event Date', 'text-domain' ), ], [ 'id' => $prefix . 'event_speaker', 'type' => 'text', 'name' => esc_html__( 'Event Speaker', 'text-domain' ), ], [ 'id' => $prefix . 'event_speaker_image', 'type' => 'image', 'name' => esc_html__( 'Event Speaker Image', 'text-domain' ), ], ], ]; return $meta_boxes; } -
AuthorPosts