1

I am working on an already set up site where the custom theme was created very much manually and the head-region markup, incl. logo, main menu, user menu, etc. are manually rendered with a particular set of CSS based on twitter bootstrap. The admin theme was left alone, so it doesn´t have those head-region markup. But I do want admin pages/forms to seamlessly be rendered with the custom styled head-region. I tried isolating the css used in the head and added it to the admin theme´s page.tpl. This proves quite disastrous, since a hell lotta css conflicts come up, esp. because of bootstrap.css.

One lousy way would be to add element specific resets. But perhaps there´s a way to shield/wrap the head and the form so that they can still coexist on the same page with their own baggages of css+js?

1 Answer 1

0

Theme nesting is not implemented in Drupal. Too much risk of CSS conflicts, and HTML and CSS does not provide any way of isolation except for iframe. There is, quite literally, no way to write an universal solution. So you may:

  • Implement resets as you need. Probably hard, but still infinitely easier than any attempt to make solution universal and foolproof.

  • Trim the admin theme to remove footer, sidebars etc, and open admin pages in iframe

  • Prepare your own theme in a way that will render admin pages in a convenient way, "borrowing" code from admin theme you like (probably it's GPL, so you are allowed to do it).

3
  • Thanks Molot. I played around with the iframe idea. The problem then is that when I submit the form, e.g. content-add/edit it refreshes to the node-view page within the iframe. perhaps there´s a hook to make submit buttons to emulate target="_top"? Also how do I control that node/user-edit tabs-clicks open the form in a targeted frame? Sep 1, 2014 at 13:54
  • hook_form_alter and #attributes can do _top, but that's a topic for another question - this site is not a forum. Similar for tabs question.
    – Mołot
    Sep 1, 2014 at 13:57
  • i tried now the iframe way. works pretty ok. but then i realised that this was a futile effort of reinventing the wheel - because the d7 native overlay module does exactly the same! Sep 5, 2014 at 19:04

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.