Forum Replies Created
-
AuthorPosts
-
July 10, 2024 at 12:43 PM in reply to: Map field default location in clonable group....via AJAX? #45871
Andrew_Vincent
Participant^^ Just to clarify my comment above... I'm not trying to edit the CPT in the back-end, but have noticed that its not possible to view the CPT - i'm guessing because of the way the CPT is defined when created by the front-end-form..? And if it's not viewable, I don't see how it can be editable.
Does that make sense?
July 10, 2024 at 12:32 PM in reply to: Map field default location in clonable group....via AJAX? #45870Andrew_Vincent
ParticipantThanks - that makes sense.
It looks like the CPT thats created on submit can't be viewed. I can view it in the back end but there is no 'View EoI" button. Is that necessary? or is the cpt content somehow appended to the confirmation message?
Should the redirect on submit be directed to the cpt URL?
July 3, 2024 at 6:38 AM in reply to: Map field default location in clonable group....via AJAX? #45819Andrew_Vincent
ParticipantCan you please confirm that I placed 'edit' => true in the right place?
July 2, 2024 at 11:23 AM in reply to: Map field default location in clonable group....via AJAX? #45806Andrew_Vincent
ParticipantMy code looks like this:
add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) { $meta_boxes[] = array ( 'title' => 'Submit Paddock', 'id' => 'submit_paddock_form_vic', 'post_types' => 'eoi', 'edit' => true, 'validation' => [ 'rules' => [ 'phone' => [ 'required' => true, ], 'full_name' => [ 'required' => true, ], 'email' => [ 'required' => true, ], ] ], 'fields' => [ [ 'id' => 'recipients', 'type' => 'hidden', 'std' => '[email protected],[email protected]', 'std' => '[email protected]', ], [ 'name' => 'Full Name', 'id' => 'full_name', 'type' => 'text', ], [ 'name' => 'Contact Phone', 'id' => 'phone', 'type' => 'text', ], [ 'name' => 'Contact Email', 'id' => 'email', 'type' => 'text', ], [ 'name' => 'NGR', 'id' => 'ngr', 'type' => 'text', ], [ // 'name' => 'Add a paddock', 'id' => 'paddock_group', 'type' => 'group', 'clone' => true, 'collapsible' => true, // Column size (1-12) 'class' => 'paddock_picker', 'group_title' => 'Paddock {#}', 'group_title' => ['field' => 'paddock_name'], 'add_button' => '+ Add a paddock', 'fields' => [ [ 'name' => 'Paddock Location', 'id' => 'paddock_location', 'desc' => 'Select the satellite view then drag the marker whilst zooming in to locate your paddock.', 'type' => 'map', 'api_key' => 'AIzaSyBUtodUtVKW1VJa9Gmzz2-VuQuwd7A7GLQ', 'std' => '-35.3453808,143.5625836,7', 'clone_default' => true, 'js_options' => [ 'mapTypeId' => 'SATELLITE', ], ], [ 'name' => 'Paddock Name', 'id' => 'paddock_name', 'type' => 'text', ], [ 'name' => 'Crop Type', 'id' => 'crop_type', 'type' => 'select', 'options' => [ 'wheat' => 'Wheat', 'barley' => 'Barley', 'feed_corn' => 'Corn', ], 'placeholder' => 'Select a crop', ], [ 'name' => 'Variety', 'id' => 'variety', 'type' => 'text', ], [ 'name' => 'Plantable Hectares', 'id' => 'plantable_hectares', 'type' => 'text', ], [ 'name' => 'Delivery Location', 'id' => 'delivery_location', 'type' => 'text', ], ], ], ] ); return $meta_boxes; });June 28, 2024 at 8:15 AM in reply to: Map field default location in clonable group....via AJAX? #45756Andrew_Vincent
ParticipantNo I think you're not understanding. The user would need to input multiple markers on a map - I don't believe that's possible.
I should theoretically be able add multiple maps to a single submission if I set the form to 'edit' => true. The newly created submission post could store the co-ordinates and set that as the default for subsequent map additions. Unfortunately the documentation on this is extremely poor so incredibly difficult to work out how to do it. https://docs.metabox.io/extensions/mb-frontend-submission/
If I set edit to true it returns a blank page on submission. How do I set the redirect to view the newly created submission post?
June 27, 2024 at 8:52 AM in reply to: Map field default location in clonable group....via AJAX? #45738Andrew_Vincent
ParticipantAnother possibility would be to add to an existing form submission post. ie map for one paddock submits; subsequent paddocks retrieve default Zoom and Location from the submission CPT Location field.
... does that make sense?
June 27, 2024 at 7:20 AM in reply to: Map field default location in clonable group....via AJAX? #45735Andrew_Vincent
ParticipantThanks. Is it possible to maybe add multiple markers to a single map?
Andrew_Vincent
ParticipantLooking for an older version of AIO. The new version is throwing an error and taking down my site completely. Unfortunately I do not have access to the server's CPanel and cannot upgrade the PHP version to the minimum spec
Andrew_Vincent
ParticipantAh thanks.
-
AuthorPosts