Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a form inside block #2006

Open
vitali-karmanov opened this issue Jul 5, 2023 · 1 comment
Open

Create a form inside block #2006

vitali-karmanov opened this issue Jul 5, 2023 · 1 comment

Comments

@vitali-karmanov
Copy link

Hello everyone,

First of all, thank you for creating Piraha CMS. I have been using it for the last month and it's been great!

The only issue I have encountered so far is how to handle forms. I would like to be able to create and submit a form inside a custom block, and ideally, receive the parameters inside CustomBlock.cshtml.

The idea is to have the ability to create and manage form submissions within a block.

I'm looking forward to your reply. Thank you!

@tidyui
Copy link
Member

tidyui commented Jul 5, 2023

Well, there are an infinite number of solutions to this problem :) But if I would build a form module I would:

  1. Add a custom DbContext with tables to keep form responses for a specific form "id"
  2. Create the form within the block (or reference a pre-defined form from a block)
  3. When submitting the form from webapplication I would post it to a custom controller with the form "id" (could be reused from block id if the form is created on the block itself).

This way I could add a isolated view in the Manager UI where all submissions for all forms could be listed, but I could also add links to the submissions from the block itself when editing the page.

This is just one suggestion though. Let me know if you'd like to collaborate on a more generic solution or if you're only interested in building something custom for you own application.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants