-
Notifications
You must be signed in to change notification settings - Fork 9
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
Example Webform usage #86
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,16 @@ | |||
import { DrupalClient } from 'next-drupal'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should initialize new Drupal Client in here. I think it needs to be something that is provided by the integrator from the Next.js application.
webformObject={additionalContent.webform} | ||
id={additionalContent.webform.drupal_internal__id} | ||
key={additionalContent.webform.drupal_internal__id} | ||
customComponents={{ date: WebformDate }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is unclear based on these docs is that what is date
? Is it the name of the form element or is it the type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type
settings={null} | ||
error={error} | ||
> | ||
<input type="date" name="date" min="2022-01-01" max="2022-12-31" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the name should be dynamically coming from the backend?
How to set up Webform REST on ACMS
Download the Webform and Webform REST modules
Enable REST resources "Webform Submit", "Webform Elements", "Webform Submission" on
/admin/config/services/rest
Set permissions
/admin/people/permissions#module-rest
for RESTful Web Services and check Anonymous User for the Webform related permissionsCreate a new webform if you have not already
/admin/structure/webform
. The code is currently hardcoded to read the field "field_webform" so you should name your field that in ACMS or change that line in the code to your field.Create a webform (Right now. text area, text input, submit, radio buttons, checkboxes, and a single checkbox are supported).
Add a webform to one of your nodes then go to the page on the headless site.