Creating a sub-theme --- blocks not rendering in the child vers

You are here

Thomas Bishop

Creating a sub-theme --- blocks not rendering in the child vers

Hello again...

I am attempting to create a sub-theme/child-theme of Dawn, just so its easier to manage my changes to the styling and because I want to keep your stylesheets clean. To this end, I haven’t made any changes to the base theme CSS, nor have I made any changes to the block structure, regions, or views.

For reference, I’m calling the sub-theme 'Thelema’ I have followed the standard procedure, creating the .yml files necessary to duplicate the styles of the base theme. I have attached the following so that you can see my implementation:

- a screenshot of the sub-theme directory structure
- a screenshot of the file thelema.info.yml
- a screenshot of the file thelema.libraries.yml

The sub-theme was successful for the most part: when I set Thelema as default, all the styles are the default styles of the base theme. The issue is that certain blocks are missing that are in the base theme. For example, using the blog page as an example, the side column, search bar etc are missing in the sub-theme version (please see the screenshot thelema-blog.png, attached).

One thing I have attempted, following the advice of Drupal.org on subtheming is to create a PHP file called thelema.info, which has the following contents:

function thelema_theme_suggestions_block_alter(&$suggestions, $variables) {
// Load theme suggestions for blocks from parent theme.
  foreach ($suggestions as &$suggestion) {
    $suggestion = str_replace('thelema_', 'dawn_', $suggestion);
  }
}

This is supposed to iron out any differences between parent and child blocks but the problem persists whether I add this file to the sub-theme directory or not.

Could you let me know if there is a way to get the sub-theme to keep the base block layout and if there is anything I might have neglected to do that would explain the rendering problem?

Many thanks.

Thomas

Attachment(s):