getThemeAreaClasses() for areas with any name
Permalink
I need to have a choice of classes for areas available. In pagetheme.php I have:
That works fine. But in order to have classes avalable for areas with any name I couldn't make it work.
For getThemeBlockClasses in pagetheme.php we have the wildcard character * for classes available to any block.
I tried the to get preset classes with the wildcard asteriks for areas, but it won't work.
What am I missing?
That works fine. But in order to have classes avalable for areas with any name I couldn't make it work.
For getThemeBlockClasses in pagetheme.php we have the wildcard character * for classes available to any block.
public function getThemeBlockClasses() { return [ 'core_area_layout' => [ 'section-fluid', ], '*' => [ 'is-expanded', 'grid-item--width2', 'zoom-box', 'hidden-print', ], ]; }
I tried the to get preset classes with the wildcard asteriks for areas, but it won't work.
What am I missing?
Thanks for replying.
I'd be using it for an Isotope Image-Blog. Using getHandleList is too complicated for me. My client would have been delighted to have an easier workflow. I guess I have to hardcode the areas in the page template.
I'd be using it for an Isotope Image-Blog. Using getHandleList is too complicated for me. My client would have been delighted to have an easier workflow. I guess I have to hardcode the areas in the page template.
Your code just requires some tiny modifications to work. Try this:
d'y donc!
works like a charm.
thanks a lot.
works like a charm.
thanks a lot.
I think the idea is, since getThemeAreaClasses() is implemented in page_theme.php so from within the theme, you most likely have a limited number of differently names areas that you have control over so you probably don't need a wildcard.
It would indeed be useful sometimes but that's the way it is, you have to find another way.
One thing you can try is using the function getHandleList() which gives you a list of all distinct area handles available. That function is in concrete/src/Area/Area.php
That will also include global areas and sub areas.
It's a static function so you can do