Problem:

Making a custom theme with blocks placed in different regions.

  • Place custom blocks in theme using the UI.
  • Export config. drush cex vcs
  • When it came time to import my config in a new environment custom blocks not appearing in proper region despite .yml files for individual blocks being present in my default config directory...

How to import configuration so that blocks from my custom theme appear in the correct region?

The solution was to disable and un-install my custom theme and then re-enable.

Here are the steps (Where vcs is our directory for default config defined in settings.php and my_custom_theme is our theme name).

After running drush si, lets import our config.

drush cim vcs --partial -y

At this point although our config has been imported our custom blocks are not appearing in the regions as set in the config .yml files.

Enable a core theme so we are free to uninstall our custom theme.

drush cset system.theme default seven

Rebuild the cache now.

drush cr

Uninstall our custom theme.

drush pm-uninstall my_custom_theme -y

Enable our custom theme.

drush en my_custom_theme -y

Set our Custom theme as default theme.

drush cset system.theme default rrre_theme -y

Import our default config.

drush cim vcs

Run Server.

drush rs

:)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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