I have created a new subtheme from the CDN Starterkit and when making the subtheme to be the default theme, I noticed all the Bootstrap settings which based theme enabled and checked (General, Components, Javascripts & Advanced...) are not inherited. I have to check it again one by one even the CDN. Is this by design ? or anything I miss when creating the subtheme that might have caused the settings not inherited from the based theme ?
Comments
Comment #2
YuanZheCSYZ commentedI tried to follow this how-to to configure the settings for sub-theme but it doesn't work.
Besides, I tried both LESS and CDN ways to create sut-themes, unfortunately neither of these works as the front-page looks like a plain html even though I have copied all the settings from the base Bootstrap theme.
Any help?
Comment #3
neardark commented[@YuanZheCSYZ] I've noticed that the JSDelivr setting under Admin > Appearances > [Bootstrap subtheme] > Advanced > CDN shows a version for 3.3.6 -- which is odd because there isn't one and the JSDelivr API isn't showing that. Be sure to choose 3.3.5 or earlier, then clear your cache.
Comment #4
markhalliwellTechnically speaking (from core's point of view, see the related issue) this issue isn't a bug, it's a side-effect of the core "bug" that got "fixed"... yay :(
Basically, each sub-theme must also include a
config/install/THEMENAME.settings.ymlfile. According to that issue, the "solution" is to simply copy the base-theme's settings file (yeah, real intuitive huh).Personally, I think they have royally borked this entire process. It makes absolutely no sense that a sub-theme doesn't "inherit" it's base-theme settings just because they choose not to include this file.
I've discussed this with @neardark and have decided to completely refactor how this base theme handles "theme settings" in 8.x. Essentially we'll be ignoring
theme_get_setting()(which no longer iterates of base theme settings) and create our own API.Comment #5
markhalliwellThis will kind of go hand in hand with this effort.
Comment #7
markhalliwellNot finished yet. Still have to migrate the CDN settings into the new
@BootstrapSettingannotation discovery and also create base-theme inheritance forTheme::getSetting(). Setting to CNW.Comment #9
markhalliwellDone:
cdn_providerandcdn_custom_*settings into@BootstrapSettingannotations.Todo:
cdn_jsdelivr_*settings into@BootstrapSettingannotation.Theme::getSetting()to utilize new@BootstrapSettingannotations.Comment #11
markhalliwellThis is now done :D
As stated above, due to how
theme_get_setting()works, I definitely wouldn't recommend using it.There is a before/after example on the bootstrap_setting() documentation page that can show you how to retrieve settings from a bootstrap theme in 8.x (given all the OO refactoring).
Comment #13
markhalliwellWhile this is mostly done, there still needs to be work done on detecting when not to use config (e.g. don't override inherited values that are the same).
Comment #15
markhalliwell