Problem/Motivation
The currently used #prefix and #suffix at the $build[$region] should be avoided. This practice has the possibility that something goes wrong (mistyped/accidentally missing opening or closing tags) and it's impossible to add new attributes (even classes) to the wrapper element without setting #prefix again. If somebody doesn't need the wrapper, he/she has to unset #prefix and suffix too.
Proposed resolution
Use #theme_wrappers instead of the current solution
Remaining tasks
Provide a patch.
User interface changes
Nothing.
API changes
Nothing.
Data model changes
Nothing.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | page_manager-avoid_prefix_suffix-2756613-8.patch | 1.25 KB | huzooka |
| #5 | use_theme_wrapper-2756613-5.patch | 723 bytes | hardikpandya |
| #2 | page_manager-avoid_prefix_suffix-2756613-2.patch | 844 bytes | huzooka |
Issue fork page_manager-2756613
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
huzookaPatch attached.
Comment #4
sneha_surve commentedComment #5
hardikpandya commentedAdded patch.
Comment #6
joville commentedI found this following issue which means that there is a plan to remove #theme_wrappers in core: https://www.drupal.org/node/2714509
Comment #8
huzookaTests fails happen because of the xPath() except only the "block-region-top" CSS class.
My problem is about that I should be able to alter the wrapper (or remove it completely if I want to). With this patch, the regions of the PageBlockDisplayVariant would get "real" regions, which means that e.g. they get pre-processable by
template_preprocess_hook(). But that also means that they get further classes (regionandregion-top) and the xPath() wont found what it searches for.So, because of that, I'd change xPaths to cssSelects.
Do you have any kind of feedback what should I do?
Comment #10
kostyashupenkoMy related comment for
Panelsmodule https://www.drupal.org/project/panels/issues/2820617#comment-15243637Comment #12
kostyashupenkoI removed hardcoded wrappers