Problem/Motivation

Creating sub-themes are hard for people.

Proposed resolution

Create a Drush wizard that walks people through step by step in helping them create a sub-theme of Bootstrap based on three different starter-kits.

Remaining tasks

User interface changes

None

API changes

None

Comments

  • Commit eb90db6 on 7.x-3.x by Mark Carver:
    Issue #2261189 by Mark Carver: Add Drush support for creating sub-themes...
markhalliwell’s picture

Component: Code » Drush

  • markcarver committed eb90db6 on 7.x-4.x
    Issue #2261189 by Mark Carver: Add Drush support for creating sub-themes...
jcnventura’s picture

Shouldn't this be marked as fixed?

markhalliwell’s picture

Status: Active » Needs work
Issue tags: -drush

No, there is still much to do. The commits above was simply the groundwork for this.

markhalliwell’s picture

Assigned: markhalliwell » Unassigned
Priority: Normal » Critical
wundo’s picture

What is the status of the drush integration?
A description of what is missing here would come handy. Could you update this issue, Mark?

markhalliwell’s picture

Issue summary: View changes

This is a general idea of what needs to still happen. Most of it should be discussed in the child issues.

Daniel Schaefer’s picture

How do I create a sub-theme on D8? The starterkits don't work.

  • markcarver committed 428f8f9 on 7.x-3.x
    Temporarily remove Drush support
    
    Issue #2261189
    
markhalliwell’s picture

Priority: Critical » Normal
StatusFileSize
new39.43 KB

Priority is being de-escalated so we can release 7.x-3.1.

  • markcarver committed e28d385 on 8.x-3.x
    Temporarily remove Drush support
    
    Issue #2261189
    
macmladen’s picture

This should be really high on priority list. There are many options, though, but drush subtheme building is a huge helper for both beginners and experienced developers.

Sass and gulp based workflow would be more important to me, personally, but this is also nothing short of essential as well.

markhalliwell’s picture

Unfortunately, it's not very high on the priority list right now.

joseph.olstad’s picture

StatusFileSize
new38.93 KB

refactored patch 10 due to readme.md changes in latest release 7.x-3.4 (or dev)

see patch

  • markcarver committed eb90db6 on 8.x-4.x
    Issue #2261189 by Mark Carver: Add Drush support for creating sub-themes...
chandeepkhosa’s picture

Will creating a SASS subtheme with drush be available in Drupal 8?

twardnw’s picture

Can this be moved back up in priority?

joseph.olstad’s picture

this patch still applies cleanly on 7.x-3.7 , just tested it.

markhalliwell’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Priority: Normal » Major
Issue tags: +needs backport to 7.x-3.x

Yes, now that 8.x-3.0 is out, let's bump up the priority.

heddn’s picture

Not to disrupt things, but would you consider that using twig and drupal console might be an easier implementation? Liberty theme went that route and it seems fairly simple to get working.

markhalliwell’s picture

Drupal Console is an entirely different beast and we'd likely need/want to support both.

markhalliwell’s picture

I really do like the idea of making all the "templates" Twig though, since that's what they really are: templates.

It would be easier to implement both Drush and Drupal Console if we simply use the site's bootstraped instance and use the existing Twig service.

The only downside is 7.x support (which doesn't have Twig or class autoloading support for that matter).

That means there's two options for 7.x:

  1. Require twig/twig in composer.json and mention that if you wish to use Drush, you have to install bootstrap via composer?
  2. Build custom renderer that essentially "mimics" Twig.

I'm kind of leaning towards the latter.

joseph.olstad’s picture

Liberty theme? 5 sites currently report using this theme

To be honest, I wanted to get my theme done the fastest, easiest way possible doing what I learned similarly in other base themes. I ended up using the bootstrap theme as a base using this patch and the cdn option and rather than add a whole bunch of other dependencies and libraries I stuck to php and implemented the sassy / prepro modules and the phpsass library , adding the .scss file to my custom theme.info file and the .css file that it compiles. In production we disable the .scss and only use the compiled .css. It was bad enough trusting the cdn, which I noticed went down at least 3 times since we released our twitter bootstrap upgraded theme. I'd like to now get off the cdn and have a local copy of this stuff but haven't gotten around to it yet.

I like things easy and it seems like the cdn option and the sassy route was the easiest to implement for us.

I've seen some pretty complicated theming schemes using grunt and ndm and bower , so many extra dependencies outside of the drupal /php ecosystem kind of turned me off. played a bit with those tools to try them but I didn't see how it would benefit me.

adding twig, seeing as D8 uses that, it might be interesting to have this in D7 , however this would probably break compatibility with 3.x based subthemes would it not?

I haven't upgraded my biggest clients bootstrap since 3.5, their theme though is working well well. However I have another site to build though, so 3.7 sounds like a good starting point with this patch.

heddn’s picture

re #24: I'm not suggesting that liberty is all that popular. I looked at it as a PoC theme to leverage twig templating to generate a sub-theme. I want the most popular theme in drupal to use that same approach, since it is so intuitive.

joseph.olstad’s picture

@markcarver regarding your comment #23. twig for D7 sounds interesting. I didn't realize it was already available for D7 in a module called twig for D7 (tfd7).

markhalliwell’s picture

No, I was not referring to that module. I was specifically referring to utilizing the Symfony (twig/twig) library to render the starterkit templates.

The only reason Twig was mentioned was because it's an obvious choice to implement in 8.x.

We'd simply need to figure out a backport option for 7.x.

I'm still leaning towards a simple preg_replace option that simply mimics anything found inside {{ ... }} brackets.

Of course, if someone is using Twig and has it installed, we should probably default to that.

joseph.olstad’s picture

patch #15 still applies cleanly against 7.x-3.10

using it for a 'yet another' new project.

markhalliwell’s picture

I'm really sorry that I haven't had a lot of time to focus on this issue like I'd have hoped. There's been a lot on my plate the past few months.

That being said, and the fact that there is existing documentation on how to create a sub-theme manually, this hasn't been huge on my list of priorities. The reality of this issue is that it's merely a "nice to have", it's not a real necessity (e.g. breaking functionality/code).

macmladen’s picture

It is a bit confusing to have issue marked as 8.x-3.x-dev and to have patch working for 7.x-3.x, those should be separated I think.

We all must understand what amount of (probably unpaid) work goes in here for all parties and respect that.

@markcarver I just tried @joseph.olstad patch #15 and it worked (I tested both bootstrap-subtheme and bootstrap-subtheme).

As far as I can tell this works for 7.x-3.10 bootstrap and provide what I would expect.

This issue is 2.5 years old, offered solution (seems to me) is working and Drupal 7 is not current version.

I'd suggest accepting this solution for Drupal 7 version (or suggest to @joseph.olstad what should be improved to qualify it for inclusion), close this issue and open new one for Drupal 8 to avoid confusion which would deal with Drupal console, twig etc.

markhalliwell’s picture

Please read above comments. This project fixes HEAD first.

gpsloco’s picture

Hi, I am sure this will make you laugh. But, as I barely know how to apply a patch to a module as in patch < file.patch, can someone please direct me to the answer for applying a patch, er, this patch to my version of drush? I use 8.1.10. Thank you so much!

joseph.olstad’s picture

@gpsloco , the patch is not to patch drush, its to patch the module to add drush support . Drush support is done on the module level.
in this case: patch -p1 < file.patch

markhalliwell’s picture

Version: 8.x-3.x-dev » 8.x-4.x-dev
Issue tags: -needs backport to 7.x-3.x

Not sure this is going to happen for 8.x-3.x.

Also, I don't think this is ever going to happen for 7.x-3.x, especially if we go the Twig templating route. There's just no way we could get consistent support in 7.x given the lack of OO code.

joseph.olstad’s picture

Patch 15 is still good as-is

If OO+ was end all be all drupal would have been written on Java using MVC as it was back in 2000/2001

markhalliwell’s picture

Sigh... that's not what I meant and did not want to start a "which OO platform is better" debate.

I just meant that the solution that I come up with (and have had in my head for a while actually) depends on a lot of classes/namespacing that just isn't very feasible in 7.x and older versions of Drush.

I don't want to have to maintain two (or more) Drush implementations.

Patch #15 isn't going in. Plain and simple.

markhalliwell’s picture

Status: Needs work » Closed (won't fix)