I want local businesses to be able to add there own listing to our directory but have a couple of questions.
Firstly i have a working form for new entries hidden link
The issue i am having is the Photo Gallery section. Is there a field where they can select multiple images or drag and drop rather than every image needing to be added individually? Also can i limit the number of entries to 4 somehow?
Secondly, if someone adds a listing how can i give them access to edit this listing?
Also if i add a listing as an admin is there a way for someone to claim a listing to be able to edit it in future?
Thanks
Neil
Dear Neil,
Q1) Is there a field where they can select multiple images or drag and drop rather than every image needing to be added individually?
Yes, it is possible, please try these:
Edit your post form (ID: 295), in section "Settings", enable option "Use the WordPress Media Library manager for image, video, audio, or file fields", then you will be able to upload mutiple images using WordPress built-in Media Library manager.
Q2) Also can i limit the number of entries to 4 somehow?
No, there isn't such kind of built-in feature, you might consider custom codes, for example:
1) Enable above option:
Use the WordPress Media Library manager for image, video, audio, or file fields
2) Use action hook "cred_form_ajax_upload_validate" to triggere a PHP function: limit the number of entries to 4, if not return an error message.
See our document:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_ajax_upload_validate
Q3) if someone adds a listing how can i give them access to edit this listing?
It seems guests(non-logged-in users) can use that form to create post, I don't think it is a good idea, you don't know which user has created the new posts, there won't be any connection between post and guest.
As a workaround, you can try these:
1) Ask user login first, and show him the page you mentioned above:
hidden link
2) After user submit the form, the new "listing" post author is current logged-in user.
https://toolset.com/documentation/user-guides/views/filtering-views-query-by-author/
3) Create a page, display a post view:
- query "listing" posts,
- filter by post's author is current logged in user,
- In view's loop, display the edit "listing" form link
More help:
https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/