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.
One feature that I'd love to see for this project is a drush command to create subthemes, kinda like what Omega and Layout Studio are already doing. That'd be sleek.
Doable?
Comment | File | Size | Author |
---|---|---|---|
#4 | patch_commit_63de55602893.patch | 2.59 KB | ssherriff |
#3 | ninesixtyfive.drush_.inc_.txt | 2.27 KB | ssherriff |
Comments
Comment #1
tsi CreditAttribution: tsi commentedCool feature.
These is done by the Omega Tools module though, and not by the theme itself, on the other hand, it says "However, the functions this module provides could be used with any theme.".
Bottom line, ATM I really don't have any spare time for additional features, we still have work to do to get to a stable release here (e.g. this issue) but if anyone wants to implement that or at least see what is needed for this to work, they're welcome.
Setting this to postponed for now.
Comment #2
tsi CreditAttribution: tsi commentedI won't be needing this so this won't be fixed unless someone wants to take this on.
Comment #3
ssherriff CreditAttribution: ssherriff commentedI've created a rough drush command that can do this. I've based it on one I found for the Zen theme and adjusted it for 965.
Basically, the attached file should be included in the theme at the top level of the theme. That will make it so once someone downloads the theme, the command 'ninesixtyfive' will now show when you type 'drush help'. Oh, also, it needs to be renamed to 'ninesixtyfive.drush.inc'.
How it is run, is:
drush ninesixtyfive --name="My Subtheme" --machine_name=mysubtheme
You can actually run it just like this:
drush ninesixtyfive
That will create a theme called 'My theme' and you'll have to rename everything again if you want to name it something else, so it is probably best to name it exactly what you want to start with.
Comment #4
ssherriff CreditAttribution: ssherriff commentedActually, here is a git patch file as well if you want to apply it to the code. I actually haven't created a patch in git before, so hopefully this worked.
Comment #5
tsi CreditAttribution: tsi commentedReally cool, thanks !
In beta6 I have decided to lose the tar file and leave a SUBTHEME directory in the base theme, I guess this will require some changes to the drush file ?
Comment #6
tsi CreditAttribution: tsi commentedThe SASS branch of 965 has a new home and is now called Sasson.
Comment #7
tsi CreditAttribution: tsi commented-- double posted --
Comment #8
tsi CreditAttribution: tsi commentedSuper cool, check this out (this will download Sasson, create a sub-theme and enable it) :
You can have full control on the theme name and machine name with :
Thanks !
Update - you can now create, enable the newly created theme and set it as the default theme in a single line, simply :
drush sns "My theme" -y
The -y automatically answers "yes" when prompted to enable the newly created theme and set it as the default theme.
Comment #9
z.stolar CreditAttribution: z.stolar commented+1M!
This is absolutely great!
Comment #10
caiobianchi CreditAttribution: caiobianchi commentedI tried and it seems that the proper command is "drush sns my_theme". sns = sasson-new-subtheme
Nice to see it.
Thank you very much for your effort.
Comment #11
tsi CreditAttribution: tsi commentedYes, we have been working on the script in the last few days and that is one of the things got changed.
Thought "sns" (Sasson New Subtheme) is more descriptive.
I have updated my comment.
Thanks
Comment #13
ahimsauziIncredible work guys!! #18 is the way to go works like a charm!
Comment #14
amirtaiar CreditAttribution: amirtaiar commentedI keep getting:
/
The drush command 'sns My theme' could not be found
Comment #15
tsi CreditAttribution: tsi commented@amirtaiar, try clearing your caches
Comment #16
amirtaiar CreditAttribution: amirtaiar commentedI did.
Try local, online... No success. Using MAC.
Comment #17
mxmilkiib CreditAttribution: mxmilkiib commenteda cache clear worked for me.
a minor issue, but it would be nice to if the command respected drush site context, so instead of;
it would be;
test sub-theme was created in /var/aegir/platforms/d7-base-dev/sites/testsite.thingsandstuff.org/themes/test
Comment #18
tsi CreditAttribution: tsi commentedGood point, but this is a closed issue, please open a new one and we'll discuss it there.