Problem/Motivation
Recipes are conceived as composable, with any given recipe often requiring a chain of other recipes. But there's little practical sense as yet of just how this would work, or of what recommended patterns might be.
Proposed resolution
Currently core's Umami install profile provides both required (config/install) and optional (config/optional) configuration. It also does something that could potentially be modelled as a config action - sets the site email address as a recipient of the feedback contact form. To get a sense of how recipes might work, a useful exercise would be to look at different models of how the Umami install profile might be divided up into recipes.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork distributions_recipes-3365143
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
thejimbirch commentedComment #3
phenaproximaI'd like to postpone this on #3417835: Convert the Standard install profile into a set of recipes. If we can convert Standard to recipes, then we can attack Umami, which is a far more complicated install profile that even touches on the need for default content. :)
Not only that, it's possible that a recipized(?) version of Umami could reuse some of the recipes that make up Standard.
Comment #4
wim leersShouldn't we take this into account while converting Standard to a Recipe? 🤔 For example for the
articleandpagenode types, as well as the various media types?Comment #5
phenaproximaWell...sure...but IMHO, converting Standard to recipes is a big enough undertaking even without having to think about Umami. We can keep Umami in the back of our minds, but it's not a priority right now.
Let's get Standard converted, and committed, first. Then see what we can reuse from it without any modifications. (I'm guessing most of its tangible content and media types will fall into that category.)
Comment #6
eli-tJust fixing what looks like copy-paste hangovers in the summary - Standard ➡️ Umami in text and standard ➡️ demo_umami in config links.
Comment #7
wim leers#5 👍
Comment #8
phenaproximaThe Umami profile substantially extends the
editorialworkflow compared to what's in Standard, so I think we'll probably want to have some config actions available to manipulate Content Moderation workflows before we do this. The only one currently open is #3422821: Add a config action to add entity types and bundles to a Content Moderation workflow, and we'll need that one, so blocking this on that.Comment #9
phenaproximaHey, look...#3417835: Convert the Standard install profile into a set of recipes is in!
Comment #10
phenaproximaUmami also ships content, of course...but #3292287: Extend recipe runner to create content provided in the recipe's /content folder is in a reviewable state, now. So blocking on that one too.
Comment #11
phenaproximaI was thinking about this a bit and it occurs to me that converting Umami to a set of recipes is a much different circumstance, and therefore has different goals and design decisions, than converting Standard.
The recipes that make up Standard are meant to be generic, reusable parts -- the kind of things you'd likely need on any site. Umami is a lot more specialized. Do we really expect, for example, that most (or even many) sites will want to have a "recipe" content type, set up in the specific way Umami does it?
To me, this means we should take a different approach in reconstructing Umami as a recipe. Namely - I think the Umami recipe can be less composable, because it's intended more to be a self-contained demo than a set of reusable parts. We should carefully consider which parts of Umami should be extracted into smaller, useful recipes that could be cherry-picked into other sites...but I suspect it will yield fewer building blocks than Standard did, and the main Umami recipe can and will be quite large and complicated.
But that's okay, because an architecture like that is in line with Umami's purpose.
Comment #12
phenaproximaSome thoughts on how to split up Umami:
enableLayoutBuilder()switch on entity view displays.)More ideas may be forthcoming, but this is just an initial brainstorm.
Comment #14
wim leers#12 sounds like a nice proposal to me! 😊
Comment #15
phenaproxima#3422821: Add a config action to add entity types and bundles to a Content Moderation workflow is in.
Comment #16
phenaproximaThe final blocker -- the ability to import default content -- is in!
Let us continue here. :)
Comment #17
thejimbirch commentedWe should set a precedent here for having default content in its own recipe. Of course, it can be applied as part of umami/recipe.yml, but it should also be able to be applied independently.
Why? I can apply a recipe on my local machine, export the config, unpack and remove a recipe (if contrib), and then push all my changes to a development, staging, or live environment. In that workflow, the content would not get pushed with it.
If we define the idea of a recipe that is content only, that could get pushed up as part of the code base and applied on subsequent environments.
I see many benefits from this, from prepopulating demos, to configuring baseline functionality, and content for quality assurance.
Comment #18
thejimbirch commented@catch wants #3425104: Umami views should use responsive grid merged into Umami before the recipe can be completed.
Other work can be done to this issue, just not that view.
Comment #19
catchI'm in two minds about this - I agree that there are very few bits of Umami that would be re-usable.
However, Umami is also supposed to be a showcase of what can be done with Drupal core and a bit of theming, so if we include recipes in 'what can be done with Drupal core', it might make sense to have the recipes more composable so that it's easier to see how it was put together? I don't know if we'll show installed recipes in a UI somewhere, but if we do, then having Umami made up of smaller recipes would appear in that UI for example, or just if people are looking through the code base to see how it was done.
fwiw I don't think #3425104: Umami views should use responsive grid needs to be a hard blocker here, we could do it after a recipe conversion too, but also it's nearly ready and just needs review. Didn't realise there was already progress on this issue.
Comment #20
thejimbirch commentedComment #21
catch#3425104: Umami views should use responsive grid is in.
Comment #22
bernardm28 commentedSeems like this would need https://www.drupal.org/project/default_content/issues/3160146
As the latest version of umami has layout builder on by default though it does not use it much since most of the content is in the body field.
Comment #23
benjifisherAre there any nodes in Umami that customize their layout? I think not:
I think that means that, in its current state, Umami does not need #3160146 in order to have its content saved in the
default_contentformat used by recipes.I was hoping that Umami would configure its display modes to "Use Layout Builder" but not "Allow each content item to have its layout customized." Unfortunately, the Full Content display mode of each content type has both options selected.
Comment #24
bernardm28 commentedAdded a default content recipe that replaces the demo_umami_content.
To test it one can comment on this line.
\Drupal::service('module_installer')->install(['demo_umami_content'], TRUE);on demo_umami.installand then run a
ddev drush site-install umamiddev recipe ...It's missing these blocks added to the block layout. Those I will probably add to the config install folder or even better as a config action. they are a custom block that's placed on the block layout.
# block.block.umami_banner_home
# block.block.umami_banner_recipes
# block.block.umami_disclaimer
# block.block.umami_footer_promo
Comment #25
bernardm28 commentedThere's one little glitch left where exported entities that have translated content end up with different IDs for the same resource (image, pdf). This results in the Spanish version of Umami having no images. Even though the English one has them all. This seems like a default content bug though.
Seems related to this.
https://www.drupal.org/project/default_content/issues/2947220
Comment #26
thejimbirch commentedMoving to Drupal core. Merge request will need to be moved also.
Comment #27
gábor hojtsyIt would be really great if the work is not lost here but can be applied to the contrib copy of Umami following #3523324: Deprecate and remove the Umami demonstration profile from core, make it a contributed site template, would that still be possible? It would be sad to need to restart this and Umami as a contrib site template would need it to be based on recipes.
Comment #28
catchUmami contrib for me means one of two things:
1. It moves under Drupal CMS as a default/example template there
2. It moves fully to contrib and is maintained there, then appears in the site templates section.
It should be possible to open a contrib umami recipe project with the contents of the recipe. The really challenging thing regardless of where it lives will be updating the Umami theme + layouts to be based on experience builder.
Comment #29
gábor hojtsyI think the theme + layouts update to XB should be done later assuming we can lift and shift Umami to contrib in a working way :) Especially if the recipe conversion works. I don't think we need to build it necessarily to have reusable components outside of it. But food blog is not a site template currently being built for Vienna, so it could be a great contrib one. It could be one of the first if not the first contrib template since we already have the site itself figured out all with images and sample content :) It would be unfortunate to not to rescue it in the tumult around Drupal CMS and site templates :)
Comment #30
catchI think the way to do that then would be to create a new
demo_umamicontributed theme, and a new umami general project recipe based on the work here. Once the policy issue is agreed, that could start alongside the gradual deprecation of Umami in core (which probably will have to work differently to how we've deprecated modules/themes anyway).Comment #31
thejimbirch commentedDoes it need to be removed from core? A site template late could still require and apply it if the recipe were in core.