1

I am using Drupal 8.

I have subthemed the Seven theme so we can add some minor customisation to the admin theme.

The new theme however is getting all the active theme's blocks thrown into - seemingly - random blocks inside its regions.

I want to create a subtheme which initially is identical to seven and can be activated across several sites with predictable block placement.

I don't want users to be put in a position were they have to go through and manually move/disable blocks after turning on the new admin theme. This is especially true given the clunky nature of adjusting block placement on the admin theme; every time you disable/delete a block and save the change it takes you back to the ACTIVE theme block page rather than the admin one...

Is there a way to do this?

1

You can provide custom block configurations in config/install as with a module. As soon as there is at least one block, Drupal will not add any additional blocks, if there are none, it will copy those from the default theme.

  • Any more detail about how to do this? In this case of Core Seven there is no config install folder but it install without block assignment issues. My block layuout is the same as seven. I don't see why it is inserting content from the active theme into my new blocks... – tanbog Jul 7 '17 at 6:08
  • Not sure what details you need. Just create the blocks you want, put them in the folder, remove the UUID done. Core has the configuration in the standard profile, if you enable seven after installing minimal, you should see the same behavior. – Berdir Jul 7 '17 at 6:59
  • Ok, I did not realise core themes had some of their config files located outside of their own folder. Thanks for that information. And I had assumed my theme would inherit any such configuration as it took seven as base. clearly not. – tanbog Jul 11 '17 at 0:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.