Jump to content

Lost lamb on creating pages


Pip
 Share

Recommended Posts

Hi Everyone! 

Need some guidance here. 

I usually think of workflows but I'm kinda stuck where to go, what to search. 

I am working on a website where vendors may create a posting (listing). When they click on say "Create" button, they go to a Terms of Use page where they have to agree. Once completed, they are redirected to a page where they can fill in the details. Details such as city where they are located becomes the parent of the page. 

Kindly note: User is not a super admin. 

Any leads is totally appreciated! 

Thanks.

Link to comment
Share on other sites

In that case you'll need to be able to track the user. Sessions work best for this (I think, better than cookies). From your description, it seems these are registered users. An example workflow:

  1. Vendor logs in.
  2. Verify, validate, etc that they are a vendor.
  3. If YES, create a session for them
  4. Then, use $session->redirect(/url/to/terms/of/usage/user1234) to redirect them to the TOCs.
  5. If they are not a vendor, $session->(/redirect/elsewhere/).
  6. Vendor completes the form. JS validation just to tell them if they forgot something
  7. Vendor agrees and POSTs form
  8. Form is posted to a page you have set up
  9. Inside the template file of that page, sanitize and validate form inputs
  10. If Errors, return back to the form
  11. No errors, $session->redirect(/fill-in-details/user1234)
  12. Vendor completes the form. JS validation to help them with stuff they might have forgotten to do
  13. Vendor POSTs form
  14. Form is posted to a page you have set up to receive completed details
  15. Sanitize and validate form
  16. Errors, redirect back to form
  17. No errors, use API to create a page for the vendor
  18. Errors creating page, tell vendor to try again (?)
  19. No errors, redirect vendor to some thank you page or wherever you want

Use ProcessWire's CSRF for the forms.

I might have skipped something.

Link to comment
Share on other sites

1 hour ago, Pip said:

Hi Everyone! 

Need some guidance here. 

I usually think of workflows but I'm kinda stuck where to go, what to search. 

I am working on a website where vendors may create a posting (listing). When they click on say "Create" button, they go to a Terms of Use page where they have to agree. Once completed, they are redirected to a page where they can fill in the details. Details such as city where they are located becomes the parent of the page. 

Kindly note: User is not a super admin. 

Any leads is totally appreciated! 

Thanks.

There is not much information. 

You say "I am working on a website". At which state are you? 

What is your experiance with Processwire? 

You may get more targetted answers if you ask steps for only a part of your project instead of the whole.. 

Link to comment
Share on other sites

44 minutes ago, huseyin said:

What is your experiance with Processwire? 

🙂 . I am not suggesting that you should have been privy to that information, by the way. 

Edited by kongondo
Link to comment
Share on other sites

3 hours ago, kongondo said:

In that case you'll need to be able to track the user. Sessions work best for this (I think, better than cookies). From your description, it seems these are registered users. An example workflow:

  1. Vendor logs in.
  2. Verify, validate, etc that they are a vendor.
  3. If YES, create a session for them
  4. Then, use $session->redirect(/url/to/terms/of/usage/user1234) to redirect them to the TOCs.
  5. If they are not a vendor, $session->(/redirect/elsewhere/).
  6. Vendor completes the form. JS validation just to tell them if they forgot something
  7. Vendor agrees and POSTs form
  8. Form is posted to a page you have set up
  9. Inside the template file of that page, sanitize and validate form inputs
  10. If Errors, return back to the form
  11. No errors, $session->redirect(/fill-in-details/user1234)
  12. Vendor completes the form. JS validation to help them with stuff they might have forgotten to do
  13. Vendor POSTs form
  14. Form is posted to a page you have set up to receive completed details
  15. Sanitize and validate form
  16. Errors, redirect back to form
  17. No errors, use API to create a page for the vendor
  18. Errors creating page, tell vendor to try again (?)
  19. No errors, redirect vendor to some thank you page or wherever you want

Use ProcessWire's CSRF for the forms.

I might have skipped something.

Thanks @kongondo! So that means I have to do a module to it? Still figuring out where to use API, Module etc.

Will check out the CSRF for the forms. 

 

Link to comment
Share on other sites

56 minutes ago, Pip said:

So that means I have to do a module to it?

Not really. It depends on the user  (both admin and vendors) experience you want.  What sort of information do you want vendors to see in the frontend? If it is simple, then you could get a way with a single page, one per vendor. On admin side, how do you want to manage vendors? Like normal pages? Do you have a mockup (GUI) we could look at?

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...