Problem
The theming system in Drupal 8 has been altered in several ways, not least of which having been moved to an OOP service (https://drupal.org/node/1886448). This means that at the very least, how Bootstrap handles theming needs to be reworked. And if we still needs to modify and alter its behavior (likely), we should do it by extending the theme and registry objects. In addition, this aspect of Drupal is still under heavy development, and is a bit of a moving target.
Goal
Rethink the way Bootstrap handles theme operations in light of the new Drupal 8 architecture.
This issue will be used to track all of the sub issues and tasks associated with this goal. It should also keep tabs on any relevant Drupal 8 core issues. Any overarch commits will be tagged with this issue number.
Comments
Comment #1
ryan.armstrong commentedComment #3
markhalliwellThe OO approach will likely have to be in a module if we actually end up needing to fundamentally change how the theme registry service works. If so, this will likely need to be implemented via a custom module inside the theme (which is possible in 8.x, "unofficially").
Or, we simply keep hook_theme_registry_alter() and reduce it to what we actually will probably need: adding includes to each hook registered.
Also, there is now a new hook in 8.x that should be utilized for adding things like the
context, icon, and icon_positionvariables: hook_template_preprocess_default_variables_alter().Comment #6
markhalliwellOk. I've fixed the theme registry altering stuff temporarily so templates and preprocessing will start working.
That being said, now it's just a huge task of converting all the theme functions and
tpl.phpfiles intohtml.twigfiles.I'm leaving this open for now as this really should be OO and fixed properly before a release.
Comment #7
ryan.armstrong commentedOk I'll start focusing on covering all of the theme functions and tpl files to Twig templates.
Comment #9
markhalliwellComment #10
markhalliwellOops
Comment #11
markhalliwellComment #13
markhalliwellComment #14
markhalliwellNow that the majority of the 8.x codebase is OO and preprocessing is discoverable via
@BootstrapPreprocessannotation plugin, this should get another once over.Comment #16
markhalliwell