Closed (fixed)
Project:
Recipes Initiative
Version:
1.0.x-dev
Component:
Documentation
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
22 May 2025 at 14:48 UTC
Updated:
10 Apr 2026 at 00:50 UTC
Jump to comment: Most recent
Comments
Comment #3
koppie commentedFollowing up on @thejimbirch's comment in https://www.drupal.org/project/distributions_recipes/issues/3549058#comm.... I've opened a new MR that does the following:
This is ready for review!
Comment #5
phenaproximaI had to open the MR; pushing a branch doesn't automatically open one. You should still be able to push changes, though.
That said, I reviewed the changes and it doesn't look like this does what is specified in the issue summary here...? I don't know if I'm on board with the phrasing that it creates a config entity "interactively", because that's not really true. It's more like the recipe will create a config entity and certain aspects of it can be specified interactively.
How about we add three examples to this new page:
Sound reasonable?
Comment #6
thejimbirch commentedAnother:
https://drupal.slack.com/archives/C2THUBAVA/p1724874830469789?thread_ts=...
To add and configure new fields in field groups.
Create the field storage configs and put them in the /config folder. These will be idempotent because nothing can ever change on them (I'm pretty sure that is true).
Use addToAllBundles to create the field instances on every type (what would you do if you only wanted it on one or 2 bundle types?)
3. Use setThirdPartySettings to create the field_groups
NOTE: Tabs may not be the best thing to do as once you do tabs, all the fields should be in the tabs or it looks funny. But the good news is you can have a bunch of field names in the children section and it doesn't break it if a bundle doesn't have that field.4. Use setComponent(s) to add the fields in the form and display
Comment #7
koppie commented> Sound reasonable?
Sorry @phenaproxima, but no. I'm volunteering my time. My motivation was that I spent hours trying to write a recipe that could take user input and save a value using the Key module. There's still no documentation for that, and I wanted to contribute.
Comment #8
phenaproximaFair enough. I do love the idea of a comprehensive set of examples, but I'm trying to ensure it is clear about what each example does. I'll try retooling the MR to clear up some phrasing, while keeping your example (which I think is a good one!) intact.
Comment #9
phenaproximaRetooled the phrasing and example slightly, in the hopes of making it a little clearer (I also fixed a bug that will actually totally prevent that recipe from working at all as-written). Assigning to Jim for review.
Comment #10
thejimbirch commentedAwesome, merge that MR. Leaving this open to add :
* How to add a field to every content type
We could also expand the Key scenario to use a file that is in private files, which is a common example on Pantheon.
Comment #11
thejimbirch commentedComment #12
nedjoNo doubt there's a point to be made that two is kinda few to start with, and fair, but personally I'd lean towards getting this in as is. It's a valuable start in and of itself. That's what our recipe documentation is: a collaborative work in progress. We can pull the remaining ideas from this issue into followups. If anything, getting what's already in this MR into the public-facing docs should get more eyes on this work and up the chances of getting more tips flowing in.
Just my 2c.
Comment #17
thejimbirch commentedMerged, thanks!