Problem/Motivation

The Starter template is not really a blank slate, since it comes with Mercury and its component library.

We should provide an option for those who want Drupal CMS as a foundation but don't want to use Mercury. For example, if they want to build a site with only code components.

It should be a clone of the Starter recipe but without Mercury and its dependencies, and we can include a single Canvas page to set as the home page just to avoid a 404 on install.

As far as the theme, it would just need the bare minimum to be functional.

Proposed Resolution

This is what I have set up in a proof-of-concept branch on this issue: in a sentence, drupal_cms_site_template_base IS the blank site template.

The ultimate idea would be that, if you follow the instructions at https://git.drupalcode.org/project/drupal_cms_site_template_base/-/blob/..., you would seamlessly end up with recipes/drupal_cms_site_template_base -- this is your blank site template -- and web/themes/blank, which is a bare-minimum (i.e., starterkit-derived) theme. Oh, and a totally blank Canvas page as your front landing page.

How to test:

  1. Check out the MR branch, and ddev rebuild
  2. ddev drush si -y ../recipes/drupal_cms_site_template_base
  3. When you log in, you should see that the "blank" theme is your default, and your home page should be completely empty.
CommentFileSizeAuthor
#13 it-looks-fine.png82.88 KBphenaproxima

Issue fork drupal_cms-3573304

Command icon 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

pameeela created an issue. See original summary.

pameeela’s picture

This was requested by @lauriii so have asked for him to review for any missing info/reqs :)

lauriii’s picture

As far as the theme, it would just need the bare minimum to be functional.

We may want to even undo some defaults from core. For example, by default core provides whole plethora of regions but it would probably make sense to limit them to just header, content, and footer.

You may want to consider adding some minor additions to the theme on top of that for example to style messages because it shouldn't really be on the site builder to have to style 'administrative' elements like that.

phenaproxima’s picture

The tricky part of this one, I think, is getting the theme scaffolded.

It seems to me like we would, for this situation, not want to ship a theme that you then fork as desired (the way we are doing it with Mercury and Byte). My reasoning is that, with Mercury and Byte, you might want to customize them, whereas in this situation, you definitely do. So shipping a clone of Drupal's starterkit_theme, which we'd have to keep up-to-date, is pointless.

To me, this is a case where we'd want to generate a theme for the site template, when you require said template into your codebase. The generated theme would just be whatever is spit out by php core/scripts/drupal generate-theme (albeit with most of the regions removed).

For this, the right move may be to resurrect the work I did in https://www.drupal.org/project/site_template_helper, which was intended to do dynamic theme generation at composer require time.

lauriii’s picture

+1 that getting a theme scaffolded would be a great experience for starting with the blank installation

phenaproxima’s picture

OK, so I got that site_template_helper plugin working. It can be set up to generate a theme, if the site template in question adds something like this to its composer.json:

"extra": {
  "drupal-site-template": {
    "generate-theme": {
      "name": "blank",
      "info": {
        "regions": {"header": "Header", "content": "Content", "footer": "Footer"}
      }
    }
  }
}

It always uses core's starterkit_theme as the base.

I think that the right thing to do here is not to create a completely new site template, but instead to just add this to drupal_cms_site_template_base. That is a completely blank site template with Drupal CMS's baseline functionality, but no design system or theme. We can also add a blank Canvas page as the home page, and have Composer (via my plugin) generate a theme on-the-fly for it.

I will create an MR branch in that project which implements that, and require it an MR branch here so @pameeela and/or @lauriii can test it out.

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Status: Active » Needs review
phenaproxima’s picture

One piece of this I didn't directly address is from #3:

You may want to consider adding some minor additions to the theme on top of that for example to style messages because it shouldn't really be on the site builder to have to style 'administrative' elements like that.

This is pretty much directly at odds with generating a blank theme on-the-fly. I am also not sure it's necessary, because core's starterkit_theme (which is the theme that gets xeroxed as blank) seems to have some basic administrative styling already: https://git.drupalcode.org/project/drupal/-/blob/main/core/themes/starte...

If we wanted to supply further customization, I think we'd have to create yet another theme, on top of the three we already maintain (Mercury, Byte, and Haven). Do we really want that added maintenance burden?

lauriii’s picture

You might be right that we shouldn't create a new theme to add styling for messages because there could be other ways to solve the problem. I'm wondering if we should create/add a module that supplies styling for messages? This could be something like https://www.drupal.org/project/simple_toasts or https://www.drupal.org/project/toastify.

phenaproxima’s picture

I have no idea why we wouldn’t just add Toastify directly to Drupal CMS! It’s Pam’s call, but that seems like a useful no-brainer of a module.

phenaproxima’s picture

StatusFileSize
new82.88 KB

Manually tested, and confirmed that we don't need to do any additional styling. The starter kit theme provides some basic styling of messages (and, probably, some other administrative elements). This is what it looks like when I create a new node after installing the empty site template:

Messages appearing when creating a node.

Very basic, to be sure, but it fulfills @pameeela's criteria from the issue summary:

As far as the theme, it would just need the bare minimum to be functional.

pameeela’s picture

This approach makes sense to me, but we will need to modify the template's metadata because the current title/description don't make sense for this purpose. Very much agree we don't want to create a new theme/project to ship with it!

The only thing that is missing is a Canvas page to set as the home page, which we should be fine to add to site template base, I think?

Re: messages, we looked at Toastify but the library is pretty much abandoned (last commit was 3 years ago) and it's so easy to solve this problem with some basic styles (and JS if desired, as in Mercury). Simple Toasts wasn't on my radar but it looks more promising since it doesn't introduce an additional dependency, but adding configuration for this feels like such overkill. It should just work! Let's evaluate this separately though.

pameeela’s picture

The only other thing to flag is that because we apply the privacy recipe we do get the utility page content type. @lauriii said ideally no content types would be included, but this might be fine. As to why we don't use a Canvas page for the privacy page -- I think that would require a new version of the recipe because that is the one recipe that I think makes the most sense to exist and be used outside of Drupal CMS. But I guess we could make a 2.x branch of it for Canvas?

phenaproxima’s picture

we will need to modify the template's metadata because the current title/description don't make sense for this purpose

This is done in the related branch of drupal_cms_site_template_base: https://git.drupalcode.org/project/drupal_cms_site_template_base/-/merge...

The only thing that is missing is a Canvas page to set as the home page, which we should be fine to add to site template base, I think?

This is also done in that same MR branch.

The only other thing to flag is that because we apply the privacy recipe we do get the utility page content type.

The utility page content type is part of drupal_cms_content_type_base, which is also responsible for bringing in Canvas. I think it's probably okay to include a utility page and the related content type, because it's actually adding value.

If we were so inclined, we could switch to using a Canvas page for the privacy policy (probably; the devil may be hiding in the details), and that would allow us to remove utility pages from drupal_cms_content_type_base. But we had discussed this, and Canvas pages don't make a ton of sense for pages that are mostly just long paragraphs of text.

If you ask me, we should just keep utility pages around. They are a sensible thing to include by default.

  • phenaproxima committed 0dddfb6a on 2.x
    feat: #3573304 Create a 'Blank' template option for users who want to...

  • phenaproxima committed 99928bd1 on 2.0.x
    feat: #3573304 Create a 'Blank' template option for users who want to...
phenaproxima’s picture

Status: Needs review » Fixed

With Pam's approval in the other issue, merged into 2.x and cherry-picked to 2.0.x.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

gábor hojtsy’s picture

Yay, thanks all!

  • phenaproxima committed 3a957ce3 on 2.x
    fix: #3573304 Add the `drupal/site_template_helper` plugin to Package...

  • phenaproxima committed 85790f55 on 2.0.x
    fix: #3573304 Add the `drupal/site_template_helper` plugin to Package...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.