3

I've created a sub-theme of the admin theme, Seven, in order to override some CSS used to display date combo inputs on a node edit form. The info file lists a new style sheet and the regions that are defined in the original Seven info file.

Everything seems to work fine if I select this sub theme as the Admin without even enabling it. I can easily override the CSS.

However, if I also enable the sub theme, blocks suddenly appear inside the admin theme whenever it's invoked*. I believe this is because the new sub theme has different (default?) settings for active blocks in the block table. (rfay has a solution for this problem here: http://randyfay.com/content/changing-theme-name-or-adding-subtheme-without-losing-block-and-theme-settings)

My question: Is it necessary to enable a theme/sub theme that will only be used as an Admin theme? If so, is there any way to avoid the block problem, or is that just the way it goes?

* Edit: A lot of blocks appear in the new admin theme when it is enabled. Below is a visualization of the blocks table. Before the custom theme is enabled, it does not appear in the block table, so there are no blocks at all. After it is it enabled, the 12 blocks from the main theme ("custom" in the table) are all placed into the content area. Blocks might end up in the Content region because regions in the enabled theme don't exist in the customized seven theme? In any case, it's just a nuisance really, and can be easily fixed using the SQL at the link above. However, if there is no downside in using an admin theme that is not enabled, the block clean up wouldn't be needed.

enter image description here

2
  • "blocks suddenly appear inside the admin theme whenever it's invoked." Well, that's what blocks are for, aren't they? ;) But where do they appear, exactly? and why don't you want them to?
    – Mołot
    Nov 18, 2013 at 8:10
  • I added more detail to the question. In this case 12 blocks appear in the content region at the moment the custom seven theme is enabled.
    – Dave Bruns
    Nov 18, 2013 at 16:23

1 Answer 1

1

No, it's not needed to enable theme to use it as an admin theme. You only need to enable it if you want to alter it's settings, both the ones in "appearance" section, and blocks. Just go to http://example.org/admin/structure/block/list/seven and http://example.org/admin/structure/block/list/your-seven-subtheme and set up the blocks the way you want them, that's all.

1
  • I guess the question is really: For a custom version of Seven, running in "overlay" mode, is there anything I'm really giving up, or any problems I might run into later if I don't enable the theme? Of course I can adjust settings for each of the 12 blocks in this case, but it does seem kind of pointless.
    – Dave Bruns
    Nov 18, 2013 at 16:12

Your Answer

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

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