Save multiple posts at once
Support › MB Frontend Submission › Save multiple posts at once
- This topic has 3 replies, 2 voices, and was last updated 5 years, 6 months ago by
Anh Tran.
-
AuthorPosts
-
October 8, 2019 at 3:11 AM #16423
Jeremy Carlson
ParticipantHi there,
I'm trying to build a calendar where users can reserve slots. Their choices get defined by other metaboxes, and Meta Box has so far performed admirably in tying everything together.
I'm going to get lots of data points with clearly defined structure, all of which need to be queried quickly, which leads me to think of a custom table, and in fact I've set one up, and it's working with frontend submission.
The tricky part is that I want to make adding events easy, and I'd like to facilitate adding more than one event at a time.
Your approach for creating cloneable groups of data is MB Group. I like it, and putting together a group seems straightforward. But it gets stored as serialized data and isn't very accessible after the fact. So maybe not the best for custom tables.
Ideally, I want functionality similar to cloning field groups, while saving data as new rows in a custom table (i.e., a new post, yeah?)
How would you approach this issue?
Thanks!
October 8, 2019 at 4:11 PM #16432Anh Tran
KeymasterHi Jeremy,
If each event is a post, then you probably don't need MB Group. Creating fields for events and saving them in the custom table is straight-forward. But that doesn't help you adding events fast.
I'm thinking about creating a custom page for entering data...
October 10, 2019 at 10:20 PM #16466Jeremy Carlson
ParticipantYeah, I got as far as a single form on a front-facing page, saving the data in the custom table. (Incredibly straightforward, love this API.)
And I'm definitely expecting to code a custom page, so I can show a date's currently-scheduled events.
TBH I don't think they need to be multiple posts; that just seems simplest. But I've already noticed that I don't need any of the typical post information, only the custom field data. So it COULD be a bunch of meta info for one post. I mainly want to be sure I can query efficiently.
I may decide to only let the form input one at a time, and make sure it's done via AJAX so it's done fast enough that the user doesn't mind...
October 11, 2019 at 2:45 PM #16478Anh Tran
KeymasterI may decide to only let the form input one at a time, and make sure it’s done via AJAX so it’s done fast enough that the user doesn’t mind…
Good idea. I didn't think about it.
If you go with event = post (with custom table), then you'll have 2 row in the DB. One in the posts table, which looks like a normal post. One in the custom table for event details. The custom table will help you query fast, while the default posts table helps you to have UI in the back end.
-
AuthorPosts
- You must be logged in to reply to this topic.