Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Starterkit is a new concept. It could be frustrating to see it in the /themes dir only to find out it cant be used like other themes. There are docs, but the adjustment could be made even easier with a nice readme in the starterkit_theme directory.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#28 | 3302654-28.patch | 5.09 KB | xjm |
|
Issue fork drupal-3302654
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 #3
xjmComment #4
lauriiiI guess something to take into account is that this README ends up in all of the themes generated with Starterkit unless we add a specific step to remove it. We should take that into account as we write docs in that file.
Comment #5
xjmRe: #4, oh, that I think negates my suggestion about adding in the sample command.
It's also actually a really good opportunity to link the docs to explain where the theme came from. We could also explicitly say "Themes generated from core's default Starterkit markup will include this README" or something to give both core devs and theme devs that clarity (and to keep the file from becoming confusing in the future).
Comment #6
lauriiiI'm wondering if we should have another README which we'd use for replacing the README on the repository when a new theme is generated 🤔
Comment #7
bnjmnmI believe it would be reasonably simple to exclude the readme on generation. We could have a followup for possibly making it an altered readme instead of removing it altogether.
Comment #8
lauriiiMakes sense 👍
Comment #9
bnjmnmAddressed this point , left the thread open.
Comment #10
quietone CreditAttribution: quietone at PreviousNext commentedI applied the MR locally and read the README. It reads well but as someone who doesn't know theming I have some questions.
1. What is the difference between generating and creating as using in the README? The first paragraph emphasizes that Startkit is for 'generating new themes'. Then later it says Startkit is for creating new themes. Then the next sentence is back to generating. Can the same verb be used?
2. The wiki page linked to for more information would not help me to know how to use Starterkit. The first paragraph on that page has instructions for creating a theme, Does that belong on this page or somewhere else? It is the second paragraph that tells me how to create a theme using Starterkit, but that is already in the README. And the third section is about using git. Where do I go to get more information about making a theme? It is not for this issue, but can the wiki page link to somewhere to get me started?
3. The other READMEs in core/themes have a last section of 'About Drupal Theming'. Should that section be here as well?
Comment #11
xjmCan you clarify this? The page explains how to use Starterkit in detail. What is missing?
Comment #12
bnjmnmI made a small change to the wording that I hope helps. When creating a theme it can be done in one of a few ways:
In other words, Starterkit-generating is one of several ways a new theme can be created.
What I wrote above is arguably more definitive than what is in the readme, but I'm concerned about devoting readme space to what something isn't, if that makes sense
Comment #13
quietone CreditAttribution: quietone at PreviousNext commented@bnjmnm, thanks, it makes more sense to me now.
#11. Ah, I have reread everything and I see my error. Section 2 does have more detail to help someone.
I then tried the command from the README and the wiki page and they all fail for me. For example,
Is there a missing step?
Comment #14
xjmI don't get the same errors as @quietone, but something is indeed wrong with the commands in both the README and the handbook page. I used 9.5.x.
This works:
Note the
../
in the relative path, which is missing from the handbook page.I'll document what did not work next but posting this so @quietone can see also.
Comment #15
xjmThis does not work:
Nor does this:
Maybe the theme needs to be enabled on the Drupal site, which Starterkit won't be?
Tried Olivero, but it's missing the magic:
Comment #16
quietone CreditAttribution: quietone at PreviousNext commented#14 does not work for me, I get the same errors. Perhaps related to the fact that I use ddev?
Comment #17
xjmOh, the theme is called
starterkit_theme
. This works:Comment #18
xjmSo I think we should remove the default commands from the README, contrary to my earlier suggestion, and just link the docs.
I made these changes to the handbook page:
https://www.drupal.org/node/3283954/revisions/view/12737292/12756376
We still need to figure out if there's issues with the script and/or relative paths for ddev causing the errors @quietone is getting.
Comment #19
xjmNW for the simple change of removing the slightly bugged instructions in favor of just linking the handbook page where we can explain it better. We might want someone to try to reproduce @quietone's issue also, but that's a separate bug to file if so.
Comment #20
xjmOK actually the relative path thing is not necessary. This also works:
The confusing text is:
I read this as " You should navigate to your themes directory and then run this command." But what it actually means is that the script writes to
drupal_root/themes
. If that's hardcoded, it could easily cause problems on environment setups like ddev's where the docroot and relative paths are different from the default core install.Comment #21
xjmI reverted my previous, incorrect change re: the relative path, and improved the docs so others won't have the same misunderstanding I did:
https://www.drupal.org/node/3283954/revisions/view/12756376/12756426
Comment #22
quietone CreditAttribution: quietone at PreviousNext commentedMade #3304433: generate-theme scripts fails in a ddev environment and uploaded a patch that does a recursive copy instead of rename.
I read the changes to the wiki page and I agree with the improvements, some of which I was planning on doing.
Comment #23
xjmFor the separate proposed README for generated themes.
Comment #24
phenaproximaFound some minor things!
Comment #25
phenaproximaOne nitpick (feel free to disregard); one minor question, and one more slightly bigger question. Also, this issue is still tagged for a follow-up.
Beyond all that, I think this is RTBC.
Comment #26
bnjmnmFeedback addressed.
Created #3305560: Expand the readme added to starterkit-generated themes.
Comment #27
phenaproximaI think that looks good. I gave it a brief manual test and confirmed that it does what the code indicates.
Cut and print, I say!
Comment #28
xjmAnd uploading a patch so this can be tested against the lower branches.
Comment #33
xjmCommitted to 10.1.x, 10.0.x, and 9.5.x. Thank you!
I thought about whether to back port this to 9.4. The only changes are when you generate a new theme; it is not like it is going to overwrite an existing theme. So the main change at runtime is the addition of a readme for the base theme. I think this is an improvement for documentation and therefore allowed in a patch with this, so I backported it to 9.4 as well.
I think this is also the last stable blocker for Starterkit! 🎉 #3305560: Expand the readme added to starterkit-generated themes. is more of a should-have or a could-have.