Closed finnlewis closed 1 year ago
The core contact forms are also config entities so, like Webform, there's no easy way to make these into Group managed content.
If we're only going to have a few of these, we could look at giving Microsite Controllers the ability to create them and assign them to a site, but I can't see any easy way to allow site admins and editors to create them.
Angie sent over these as examples, with the message:
Here are screenshots of to of two contact forms currently used. The fostering form was created by an external org and has basic branching.
Croydon Safeguarding Children Partnership.pdf Fostering Enquiry Contact Form1.pdf Fostering Enquiry Contact Form2.pdf Fostering Enquiry Contact Form3.pdf Fostering Enquiry Contact Form4.pdf Fostering Enquiry Contact Form5.pdf Fostering Enquiry Contact Form6.pdf
I think we need to create a solution for this.
@ekes and @stephen-cox were discussing embedding a webform in a node and passing config from the node fields to the embedded webform to override certain fields / config values.
Is this a goer?
@stephen-cox perhaps we discuss the feasibility of Group 3.x with @ekes first, at which point Drupal core contact forms should be easier.
If we're not going the Group 3.x route, we look at the "embedding a webform in a node and passing config" route.
If we are going the Group 3.x route... we might have more flexibility.
embedding a webform in a node and passing config from the node fields to the embedded webform to override certain fields / config values.
@ekes has done this in the past.
If we can get away with:
Then maybe this will be quick!
@finnlewis @ekes I think this a good workaround, thanks. We should mention this along with a move to group 3.x when available which will open up the possibility of integrating with Croydon's Webforms work
@ekes has made a start on this.
Scenario 1:
Scenario 2:
Scenario 1 does not rule out extending to scenario 2.
Super basic foundation for Scenario 1 https://github.com/localgovdrupal/group_webform I'm unsure if it should be a generic module, with a localgov_microsites_webform submodule tweaking it, or if we should just go in and customize for our specific use case in a module that declares the group relatioship type.
Presently the code is based on gnode, it's kinda the basic you need to make a relationship to entity type in a group. Everything ends up with the default group content urls and admin lists. So they probably want tweaking.
Permission options are too. Turning on and off individual webforms would then be a group_permissions task -- like turning off content types: events, news etc.
For mailing forms etc. it should be possible to use tokens. The site admin email for example is different per domain, so a token for that value would send it to the domains email address. Tokens can also be used to get values from where webforms are embedded, depending how this is done.
@finnlewis to test this!
My testing is looking promising, but I need to work out the list of tasks to make this operational.
Currently I have done the following:
Entity: Add submission entities Entity: Delete any submission entities Entity: Delete own submission entities Entity: Edit any submission entities Entity: Edit own submission entities Entity: View any submission entities
Next up, need an itemised list of tasks to make this usable.
2 microsites each with one webform each
/node/5 belongs to microsite 2 http://localgov-micro-1.lndo.site/node/5/webform/results/submissions - can access this page though there are no submissions
we also need to enable the localgov_microsites_group_webform module in the profile
and finally, do we want microsite controllers to be able to create webforms ? currently they can't
I've added a couple of things here: https://github.com/localgovdrupal/localgov_microsites_group/pull/347 for your review @finnlewis
Styling changes here: https://github.com/localgovdrupal/localgov_microsites_base/pull/180
We've merged this in now, good work all!
User story
As a microsite editor
I want to have a simple contact form for which I can configure the destination email
So that we can encourage visitors to get in touch with us.
Notes:
In the microsites working group meeting this was considered a must have feature. Notes are here: https://docs.google.com/document/d/1Y63d87PP6gc89m01NjJRUwsLzv5GWxRxDXgRG3-vbM4/edit#heading=h.lmjuqvwm89xn
The current understanding is that webform will not work with group module 1.x, as we can't easily assign config entities to a group. group 2.x / 3.x might allow us to pursue this path.
In the mean time it is worth exploring the Drupal core contact form module. Does it play nice?