I wanna know if the Toolset frontend post submission form can allow me to add a user login/registration form at the end of the form and before submitting the post data, User needs to log in or register, and then based on the user account, post data will be submitted and this submitted post will be assigned to the user.
For Example, I am a new visitor in a real estate website, and I want to submit a property but I don't have an account or I am not logged into my account. and I simply open the property listing form and start filling the property data and at the end, I log in or register my self and once my account is created or I am logged to my account using Ajax or something then this enter property will be assigned to my account.
So Please let me know if this is something possible with Toolset forms somehow.
Hello and thank you for contacting the Toolset support.
Toolset forms, for a post or for users, allow to create or edit ONLY ONE post or user at a time. So, this feature is not available by default. But you can still implement it using a custom code.
What can be implemented without custom code is to have a page with a login form and/or registration form. The login form can be configured to redirect to the create post form. The registration form can be configured to redirect to the login form.
With some custom code, you can implement that. Add a generic field for the user email, and if you want a generic field for the username. Then using custom code hooked to the cred_save_data action, you can check if a user with the same email exists. If it exists, make it the author of the post. If it does not exists, create a new user with this email, and make it the author of the post. https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data