Skip Navigation

[Resolved] Adding business entries via form and managing them

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 3 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1586345

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

#1586397

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/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.