0

My client wants some basic changes to the Drupal admin pages (yay!) so I'm trying to create a sub-theme of the core seven theme. I have my sub theme working and my css is being loaded, but the local admin menu normally shown in the header of the seven theme had been replaced by the branding block and main navigation from normal pages.

Here is my info.yml file :

name: My Admin
type: theme
description: A sub-theme of the seven admin theme.
core: 8.x
base theme: seven

libraries:
  - my_admin/global-styling

and libraries.yml :

global-styling:
  css:
    component:
      css/style.css: {}

I've tried copying seven.theme file to my sub-theme folder and renaming the functions with my theme name (which has an underscore), but no love there. Any ideas how to do this properly ?

0

I think you need to copy the regions as well. Here's the YML from our custom Admin theme.

name: MY Admin Theme
type: theme
description: 'My administration theme'
core: 8.x
base theme: seven
libraries:
  - my_admin/global-styling

regions:
  header: 'Header'
  pre_content: 'Pre-content'
  breadcrumb: Breadcrumb
  highlighted: Highlighted
  help: Help
  content: Content
  page_top: 'Page top'
  page_bottom: 'Page bottom'
  sidebar_first: 'First sidebar'

ckeditor_stylesheets:
  - ../main_theme/css/style.css
  • Adding regions didn't work. In the end I abandoned this method and created a custom module to load a stylesheet onto admin pages. – AyexeM Oct 15 '17 at 16:57
0

You have to copy the region definitions from seven to your subtheme.

And most likely you'll need to reassign all blocks to their correct region in Admin -> Structure -> Block layout

  • This didn't work for me. In the end I created a custom module to load a stylesheet onto admin pages. – AyexeM Oct 15 '17 at 16:58

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.