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

simone960 created an issue. See original summary.

YuanZheCSYZ’s picture

I 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?

neardark’s picture

[@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.

markhalliwell’s picture

Title: Subtheme doesn't inherit the settings from based theme » Introduce a proper Theme Settings API
Version: 8.x-3.0-alpha1 » 8.x-3.x-dev
Assigned: Unassigned » markhalliwell
Category: Support request » Task
Priority: Normal » Critical
Related issues: +#2235901: Remove custom theme settings from *.info.yml

Technically 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.yml file. 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.

markhalliwell’s picture

This will kind of go hand in hand with this effort.

  • markcarver committed ecc6523 on 8.x-3.x
    Issue #2621064 by markcarver: Introduce a proper Theme Settings API
    
markhalliwell’s picture

Status: Active » Needs work

Not finished yet. Still have to migrate the CDN settings into the new @BootstrapSetting annotation discovery and also create base-theme inheritance for Theme::getSetting(). Setting to CNW.

  • markcarver committed e51af05 on 8.x-3.x
    Issue #2621064 by markcarver: Introduce a proper Theme Settings API
    
markhalliwell’s picture

Done:

  • Moved cdn_provider and cdn_custom_* settings into @BootstrapSetting annotations.

Todo:

  • Convert cdn_jsdelivr_* settings into @BootstrapSetting annotation.
  • Replace Theme::getSetting() to utilize new @BootstrapSetting annotations.

  • markcarver committed 699839b on 8.x-3.x
    Issue #2621064 by markcarver: Introduce a proper Theme Settings API
    
markhalliwell’s picture

Assigned: markhalliwell » Unassigned
Status: Needs work » Fixed

This 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).

  • markcarver committed 9c0f928 on 8.x-3.x
    Issue #2628530 by markcarver: Introduce a proper Update API
    
    Issue #...
markhalliwell’s picture

Status: Fixed » Needs work

While 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).

  • markcarver committed c908e08 on 8.x-3.x
    Issue #2621064 by markcarver: Introduce a proper Theme Settings API
    
markhalliwell’s picture

Status: Needs work » Fixed

  • markcarver committed ee6f509 on 8.x-3.x
    Issue #2397407 by markcarver: Move CSS/JS altering to Libraries API...

  • markcarver committed 6fcdafb on 8.x-3.x
    Issue #2621064 by markcarver: Introduce a proper Theme Settings API
    

Status: Fixed » Closed (fixed)

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