Posted by caiobianchi on November 23, 2011 at 1:28am
10 followers
| Project: | Sasson |
| Version: | 7.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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?
Comments
#1
Cool 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.
#2
I won't be needing this so this won't be fixed unless someone wants to take this on.
#3
I'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.
#4
Actually, 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.
#5
Really 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 ?
#6
The SASS branch of 965 has a new home and is now called Sasson.
#7
-- double posted --
#8
Super cool, check this out (this will download Sasson, create a sub-theme and enable it) :
drush dl sasson
drush cc all
drush sns "My theme"
# [Edit] - the next lines aren't needed anymore, see update below
# drush en mytheme
# drush vset theme_default mytheme
You can have full control on the theme name and machine name with :
drush sns "Full Name" machine_nameThanks !
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" -yThe -y automatically answers "yes" when prompted to enable the newly created theme and set it as the default theme.
#9
+1M!
This is absolutely great!
#10
I 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.
#11
Yes, 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
#12
Automatically closed -- issue fixed for 2 weeks with no activity.
#13
Incredible work guys!! #18 is the way to go works like a charm!
#14
I keep getting:
The drush command 'sns Customer' could not be found/
The drush command 'sns My theme' could not be found#15
@amirtaiar, try clearing your caches
#16
I did.
Try local, online... No success. Using MAC.
#17
a cache clear worked for me.
a minor issue, but it would be nice to if the command respected drush site context, so instead of;
$ pwd/var/aegir/platforms/d7-base-dev/sites/all/themes
$ drush dl sasson
Project sasson (7.x-2.2) downloaded to /var/aegir/platforms/d7-base-dev/sites/all/themes/sasson. [success]
Project sasson contains 2 themes: SUBTHEME, sasson.
$ drush cc all
$ cd /var/aegir/platforms/d7-base-dev/sites/testsite.thingsandstuff.org
$ drush sns test
test sub-theme was created in /var/aegir/platforms/d7-base-dev/sites/all/themes/test
it would be;
test sub-theme was created in /var/aegir/platforms/d7-base-dev/sites/testsite.thingsandstuff.org/themes/test#18
Good point, but this is a closed issue, please open a new one and we'll discuss it there.