1

I am creating an admin theme to manage certain content type. I was able to use Claro as base theme so everything is there. However, The primary-local-tasks items ( edit, view, delete..) are missing. Instead is rendering my Navbar into the admin view.. I am not sure how or what is going on. This is my first time creating an admin theme any guidance would b e appreciate it.

this is before

enter image description here

This is after: enter image description here

1 Answer 1

1

When you install a theme Drupal tries to build a block layout automatically, but the result only works for front-end themes. For admin themes you need to provide a default block layout. See the default config of the base theme:

core/themes/claro/config/optional/

block.block.claro_breadcrumbs.yml
block.block.claro_content.yml
block.block.claro_help.yml
block.block.claro_local_actions.yml
block.block.claro_messages.yml
block.block.claro_page_title.yml
block.block.claro_primary_local_tasks.yml
block.block.claro_secondary_local_tasks.yml

You can copy these files, adjust the file names and replace the theme name within the file. If you copy the files from an exported config then remove UUID and config hash.

If you want to install this only a few times you can also visit the block layout and move/create blocks until it looks the same as the layout of the installed base theme. After that you can always copy the result of the exported config to the themes folder to make further installations easier.

5
  • Sorry didnt realize your answer, I will give it a try and update here what i get. Thank you very much Jun 11, 2022 at 11:02
  • I copied the files and changed the theme name to my cusomt_admin. I moved the files to cusom_admin/config/optional/.. I am not sure how to test if its actually working.. still having my main navbar in my admin theme instead of the task tabs Jun 13, 2022 at 4:58
  • To test the default config files you have to uninstall and re-install the theme.
    – 4uk4
    Jun 13, 2022 at 6:17
  • okey, unsintalling and re-installing got me somewhere, now the navbar is no more but the task tabs are also not showing. Jun 13, 2022 at 7:26
  • I forgot to change the names of the id as well thats why it wasnt working. now its working. Thank you very much. Jun 13, 2022 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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