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

ryan.armstrong’s picture

Issue summary: View changes

  • Commit a8e7430 on 8.x-3.x by ryan.armstrong:
    Issue #2247445 by ryan.armstrong: Commenting out and adding @todos.
    
markhalliwell’s picture

The 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_position variables: hook_template_preprocess_default_variables_alter().

  • Commit 65353e4 on 8.x-3.x by Mark Carver:
    Issue #2247445 by Mark Carver | ryan.armstrong: [META] Refactoring...

  • Commit 1384261 on 8.x-3.x by Mark Carver:
    Issue #2247445 by Mark Carver | ryan.armstrong: [META] Refactoring...
markhalliwell’s picture

Ok. 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.php files into html.twig files.

I'm leaving this open for now as this really should be OO and fixed properly before a release.

ryan.armstrong’s picture

Ok I'll start focusing on covering all of the theme functions and tpl files to Twig templates.

  • Mark Carver committed 1384261 on 8.x-3.x.x
    Issue #2247445 by Mark Carver | ryan.armstrong: [META] Refactoring...
  • Mark Carver committed 65353e4 on 8.x-3.x.x
    Issue #2247445 by Mark Carver | ryan.armstrong: [META] Refactoring...
  • ryan.armstrong committed a8e7430 on 8.x-3.x.x
    Issue #2247445 by ryan.armstrong: Commenting out and adding @todos.
    
markhalliwell’s picture

Assigned: markhalliwell » natted
markhalliwell’s picture

Assigned: natted » neardark

Oops

markhalliwell’s picture

Title: [META] Refactoring Bootstrap Theme Registry » Refactor Theme Registry
Assigned: neardark » markhalliwell

  • markcarver committed 0439b6c on 8.x-3.x
    Issue #2247445 by markcarver: Refactor Theme Registry
    
markhalliwell’s picture

Assigned: markhalliwell » Unassigned
Status: Active » Fixed
markhalliwell’s picture

Assigned: Unassigned » markhalliwell
Status: Fixed » Needs work
Related issues: +#2624420: Restructure code into OO

Now that the majority of the 8.x codebase is OO and preprocessing is discoverable via @BootstrapPreprocess annotation plugin, this should get another once over.

  • markcarver committed 32a8dd2 on 8.x-3.x
    Issue #2247445 by markcarver: Refactor Theme Registry
    
markhalliwell’s picture

Assigned: markhalliwell » Unassigned
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.