Hopefully this isn't a duplicate or by design, couldn't find it anywhere.

I have Administration Theme enabled, but navigating to admin/build/block still applies the default theme, rather than the one I have selected for the Administration theme.

Comments

mmilo’s picture

Status: Active » Closed (fixed)

Nevermind.

For my custom theme I'd removed the "tabs", and didn't realize that changing the tab (theme) there would reload the page so that you could view the blocks based on the theme.

\\

dave reid’s picture

Status: Closed (fixed) » Closed (works as designed)

It's by design. The block page loads the current theme you have selected in the blocks tabs so you can see how the blocks will look in the theme. At admin/build/block, you are adjusting the blocks for the default theme, hence the default theme is loaded on that page.

In block_admin_display_form():

function block_admin_display_form(&$form_state, $blocks, $theme = NULL) {
  ...
  // If non-default theme configuration has been selected, set the custom theme.
  $custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland');
  init_theme();
PEpe’s picture

Status: Active » Closed (works as designed)

If it's design, so it's a bad design. What I remember, always work blocks administration so, that was able switch between different themes. Now it is not possible to configure the blocks in other than the selected (site setting) theme, but that should be throught switching tabs.

PEpe’s picture

Status: Closed (works as designed) » Active
dave reid’s picture

Status: Closed (works as designed) » Active

You are able to configure blocks in more than one theme, but you need to make sure you have more than one theme enabled at admin/build/themes. Once you have multiple themes enabled, if you go to admin/build/block you should see multiple local tasks/tabs for each theme's blocks.

dave reid’s picture

StatusFileSize
new89.73 KB
new61.04 KB
new40.53 KB

Here's screenshots from my website where I have two different themes enabled.

dave reid’s picture

Status: Active » Closed (works as designed)
PEpe’s picture

I have it similar like you (Gerland, RootCandy, MyOwn)... But when i click on "theme tabs" (blocks-garland.png), I am still in admin theme (RootCandy) (but the same when I disable admin theme) and i still see only admin theme blocks... But probably I made some fucking bug in MyOwn theme or in some of my own modules... I use ThemeKey module to switch theme when i click on "theme tabs" and it works... I find the problem (my stupid) maybe later :-) Sorry for my English.

Anonymous’s picture

My installation is doing the same thing. When I try to change the blocks for other modules, the theme does not switch. It retains the admin theme's layout and options. On a fresh install of Drupal 6, it works fine for me. But with my upgraded version (from 5 to 6), it doesn't work properly. Does anyone know why the layout and options would not switch on the block admin pages? Thanks.

Anonymous’s picture

It looks as though this may be related to a contrib module calling init_theme() before it should:

http://drupal.org/node/288148

noslzzp’s picture

Whatever it is, it's a major problem when building new themes with non-standard block areas. I just started the retardedly steep drupal learning curve and this has been a major roadblock.

Question, how do you add a brand new block region and then be able to assign content to it, when you can even see the region?

The administration theme should remain in effect for assigned block content. If I want see what the site looks like, I can simply bring up another browser. Why force a broken theme into play?

pvanderspek’s picture

Status: Closed (works as designed) » Active

Instead of always choosing the default theme to show the blocks admin page, I think it should be possible to change this behavior. A setting that allows you to choose which theme to use would be much better IMHO.

sun’s picture

Status: Active » Closed (works as designed)

No, as mentioned before, it's by design. Drupal supports multiple themes and we won't drop that feature anytime soon.

j0rd’s picture

Status: Closed (works as designed) » Active

Here's my issue which is related to this. This is the best thread I could find on the issue.

I use Zen sub-theme for my end user theme. I use Garland for my administration theme.

Zen Theme has additional regions to Garland, like Content Top and Content Bottom.

I've added blocks into these Regions. Problem is, when I set Garland as my administration theme under my Zen-subtheme and visit the blocks page, I'm only displayed the regions for the admin theme (Garland), which is missing the additional regions for Zen (Content-Top, Content-Bottom).

Now I'm not interested in content bottom and content top showing up in garland. I understand this theme doesn't support these regions. What I would like though, is the ability to admin these regions under my administration theme (Garland) for my actual theme (Zen).

Currently I have to disable my admin theme, and admin these regions in Zen, then switch admin theme back to Garland. I assume this could probably be fixed, by adding the additional regions to garland, but I believe that's a work around and not a solution.

hfidge’s picture

Yeah this is fricking annoying when trying to create sites with have content divs overlaying each other.

One site I'm creating for a customer has various images overlaying parts of the main content area. Lo and behold when you try and edit the blocks page, half the blocks admin settings are unclickable behind the images. I've made the admin theme with these areas disabled, so everything is great in admin, but thanks to this "feature" the blocks page is all but unusable and I certainly wouldn't want to pass this on to the client.

This is another reason why in general I steer clear of Drupal in favour of other CMSs. The learning curve is rediculous, and by the time you've used CCK, views and panels to create a custom content layout you might as well just have coded a Joomla or Wordpress module from scratch. Drupal is a great idea, and I look forward to seeing what it looks like in 5 years time, but right now I find other CMSs are far easier to work with, and far quicker to get something up and running.

Anyway, I can see the reason for this "feature" but for the love of god provide an option to turn it off. Not everyone wants to create 3 column blog layouts, and a lot of people CREATE DEDICATED ADMIN THEMES to get around any issue they have with zones. I would offer to help create a module to do this, but I'm afraid I find the Drupal API impenetrable and I simply don't have time to devote to it :(

You CAN edit /modules/blocks/block.admin.inc to force Drupal to show the blocks page in the chosen admin theme. BUT whichever changes you then make will not be transferred to the default "user" theme, you won't see any changes when you log out of admin.

function block_admin_display($theme = NULL) {
  global $custom_theme;

  // If non-default theme configuration has been selected, set the custom theme.
  // $custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland');
  // Display admin theme
  $custom_theme = variable_get('admin_theme', '0');
 
  // Fetch and sort blocks
  $blocks = _block_rehash();
  usort($blocks, '_block_compare');

  return drupal_get_form('block_admin_display_form', $blocks, $theme);
}

You MIGHT also be able to get away with something along these lines in a custom module enabled on your site, although i've not tested it yet:

function yourmodule_init() 
{
    if ( some condition here like arg(0) == 'foobar' 
         or node_load(arg(1))->type == 'something' )
    {
      $GLOBALS['custom_theme'] = variable_get('admin_theme', '0');
      drupal_add_css(drupal_get_path('module', 'system') .'/admin.css', 'module');
      drupal_add_js(drupal_get_path('theme', 'myadmintheme').'/jscripts/adminjs.js');
    }
}

rjbalest’s picture

The page just needs a 3rd tab called 'preview'. So, 'list', 'add', 'preview' on the blocks admin page. 'list' should just list the blocks because while developing, the layout can be so messed-up at times that the page is literally rendered unusable. Like, right now, I can't even disable a particular block because it's hidden underneath the rendered version of itself! 'preview' can do what 'list' does currently and everyone would be happy I'll bet.

mkelly’s picture

rjbalest++!

I understand the design decision here, but there are some instances when it is not preferable for the block admin page to render in the theme you're adding blocks to.

Example: The site I'm working on has a somewhat narrow central column. The block admin page content does not fit in that central column - so instead it gets pushed off to the right, partially obscured by the right sidebar.

What is the appropriate way to work around this issue? I could change the theme and make the central column wider, but there's no reason for that - it's not meant to display content such as the block admin page. I like rjbalest's suggestion of a "Preview" tab.

gkatsanos’s picture

Priority: Minor » Normal

Hello,
I had this problem in 5.x , now I am trying to create my own theme in 6.x and it's still there.

How am I supposed to edit/see/preview my theme blocks? My custom theme is stripped down, I have added no php calls in order to show admin stuff. It is either bad design from the Drupal team, OR you could just tell us what php calls/code we should add (or not remove when we clear an old theme to make ours) in order to see the admin stuff we need .. (assign blocks to regions etc etc)

gkatsanos’s picture

or let's just say I don't want to put print $content to my user theme. Let's suppose that in the Homepage there is no content. There has/had to be some kind of workaround to this thing.

quicksketch’s picture

Category: bug » support
Status: Active » Closed (fixed)

As noted above, the fact that the blocks page is shown in the current theme for which you're configuring blocks is intentional, so I'm moving this to a support request.

In Drupal 7, we have a "Preview" page like rjbalest was asking for in #16.

@gkatsanos You MUST print out $content in your page.tpl.php file. It's the main content of the page. If $content doesn't contain what you want it to, then that should be changed at the module layer or by theming the content provided by a module.

birdrockdesigns’s picture

So....what about users in 6.x?

It's quite infuriating. The only page in admin, that doesn't show up in the designated admin theme, is the blocks page.

I understand the thought process behind this, but it is extremely limiting with the way sites can be built, you are limited by drupal's block page.

So, there is a fix in the works for drupal 7 - what about something for 6.x? I've googled and read forums galore - and even tried to tweak the block-admin-display-form.tpl.php - but ran into css issues. If I decrease the width of "center" or "squeeze" - then this happens for the custom theme as well - it's difficult to assign a class or id to "center" or "squeeze" just for the admin blocks page. There is no page identifier.

The layout of the blocks page in the custom theme looks horrendous. The blocks list is thrust to the right and below the left sidebar, making for a designers nightmare.

I wish there was a way to control this through css, which seems to be the most logical way to do it, but there are no classes or ids that are specific to the blocks admin page.

If what you say is true about drupal 7, then I can't wait for a stable release!!!

Thanks as always to all contributers.

birdrockdesigns’s picture

Bump

Anyone??

hfidge’s picture

I asked this on Stack Overflow a few months back:
http://stackoverflow.com/questions/1393464/drupal-administration-theme-d...

I think this issue highlights that Drupal is unable to cater for everyone. If you're creating a funky design with loads of overlay divs and things which go "swoosh" it's likely that you're going to have issues coding the site with Drupal.

However - if you're determined you can get around it by applying different style sheets, which WILL apply to the blocks admin page as well, even though it tries to use the user-front-end view.

Most themes add "is-admin" as a css class to the tag - and it is this which you can use to theme the blocks-admin page. Just display:none any of the theme elements which are getting in the way.

unxposed’s picture

A crude way to get around this is to put this up top in your themes page.tpl.php:

$page_info = array();
$page_info['root'] = '/drupal';
$page_info['page_url'] = rtrim(substr($_SERVER["REQUEST_URI"], strlen($page_info['root']) + 1), '/');

if (substr($page_info['page_url'], 0, 5) == 'admin') {
	header('Location: http://www.example.com/admin/build/block/list/rootcandy');
}
stephenls’s picture

marqpdx’s picture

hi All,
i have the same problem, using a Zen sub-theme.

I noticed there is an Element which seems to cause most of the headaches:
it is (using FireBug):

<table class="sticky-header" style="position: fixed; top: 0px; width: 315px; left: 1001px; visibility: hidden;"><thead>
    <tr>
      <th style="width: 50px;">Block</th>
      <th style="width: 149px;">Region</th>
      <th colspan="2" style="width: 77px;">Operations</th>
    </tr>
  </thead></table>

Notice the position being "fixed" - when, in FireBug i change that to "relative", the table snaps into place and looks fine. No prob at all.

But, i can't find that code anywhere. i think it's computed somehow.

Anyone want to help track this down?
thanks,
m

matthewv789’s picture

Category: support » bug
Priority: Normal » Major
Status: Closed (fixed) » Needs work
StatusFileSize
new7.36 KB

This is a longstanding bug (and a fairly major one at that). I'm not quite sure why the Drupal contributors can't see the problem here (everyone has their blind spots it seems), but I'll try to explain:

ISSUE: BLOCK ADMINISTRATION PAGE LOADS WRONG THEME
Drupal version: 6.17

Due to loading in the site's default (front-end) theme rather than the designated administration theme, the administration page for editing blocks (/admin/build/block) may:
- Lack link to "Add block" functionality
- Lack link(s) to view block list in alternate theme(s)
- Lack descriptive text: "This page provides a drag-and-drop interface for assigning a block..."
- Lack link to [more help...]
- Lack labeled areas to drag blocks to
- Prevent access to blocks or block positions due to being obscured behind other elements or other layout problems
- Confusingly and unexpectedly present different appearance from other administration pages without explanation
- Fail to load entirely due to a PHP error in the theme or other cause

The irony is that starting off loading this page in the selected administrator theme (presuming the administrator theme is a mature, fully-functional theme suitable for administration usage) would retain 100% of the intended functionality, INCLUDING the ability to easily view and edit the block list in the site's default (front-end) theme, or any other active theme, by using the provided links (/admin/build/block/list/themename). While some functionality may not be fully usable if the default theme is broken (ie, custom positions not present in the administrator theme), at least it guarantees that basic functionality (ie, Add block) will always work.

This is not a feature request (as noted above, all required features are already present when the page loads in the administrator theme, because it also allows switching to other themes via the provided links) or a support request ("support" would amount to figuring out workarounds): it's just a bug.

(The attached image shows the entirety of the Block editing functionality in an under-construction theme.)

toastyghost’s picture

Version: 6.9 » 6.19

Still there in 6.19... this doesn't feel like a feature, but rather a usability issue. Overall, I'm actually very happy with Drupal so far, but it could definitely do without this particular quirk.

quicksketch’s picture

Category: bug » support
Status: Needs work » Closed (works as designed)

See #20. This WILL NOT be changed in Drupal 6 and has been "fixed" in Drupal 7. There's nothing that we can do.

solodky’s picture

I have a problem on my site:
"Tt's by design. The block page loads the current theme you have selected in the blocks tabs so you can see how the blocks will look in the theme"
is NOT working for me..as I choose different themes tabs I get the same admin theme showing with it's same regions ..This worked a few weeks ago.
Only way I can assign blocks to regions on a theme is to make that theme the admin theme. Clicking on the Theme tabs in blocks does NOT change themes/regions for me.
when is Drupal gonna tighten up?

mghatiya’s picture

My ++ to #14

I wonder how others are able to configure anything in blocks without what Jord mentioned in #14 being possible.

seanberto’s picture

subscribing.

matthewv789’s picture

I just want to note that this bug also applies to editing users, and viewing page versions/diffs (that I know of, are there any more places it does this?), for no apparent reason in either case. It's a fundamental cognitive design flaw. I like to call it an "intentional design flaw bug".

This is poor design and bad usability for two reasons:

1) Bad user experience (jarring lack of consistency) when it switches between two different appearances and layouts during administrative use. I guarantee that no site admin user will ever understand why this happens, or ever agree that it is a correct or desirable behavior.

2) It forces theme developers to make their theme into a full admin theme. (The feature that supposedly selects a separate "administration theme" is a scam since it doesn't really work; it ought to be removed until it actually works across all admin functions.) This is the biggest thing that makes Drupal theme development notoriously (and deservedly) difficult - having to develop a theme that works simultaneously as a front-end theme for the site (as designed for end-user use) and as a full back-end administration theme (as required by capricious Drupal core choices). It's hard enough to do one or the other, let alone both simultaneously in the same theme... WordPress and Joomla don't ask you to develop your admin theme as part of your site's front-end theme. (In fact, I can't think of another CMS that does so, probably for good reason...)

I know Drupal 7 is supposed to improve some of this, but the consistently smarmy "we don't care about design or usability or your annoying user requests" attitude from developers (albeit volunteers) in response to valuable feedback is pretty disappointing. If you don't listen to your "customers" (especially where they consistently disagree with you - an indication that you are likely wrong), they will stop complaining - because they will have gone elsewhere. (In some ways it's too bad you are not a commercial entity - you would have fixed this years ago, or gone out of business.)

nlambert’s picture

Just a thought...

you can always create an additional template file for the admin/build/block page

edit: Actually, I take that back. I overlooked many considerations. I also agree that the admin theme should work on the blocks and user edit pages. Maybe this should be part of the admin_theme project => http://drupal.org/project/admin_theme

edit#2 : It IS part of the admin_theme project, however, it doesn't seem to work on the admin/build/blocks page, but does work for the user pages

edit#3 : Here is a support request for admin_theme concerning the same issue http://drupal.org/node/382990

metakel’s picture

I have the same problem with #30 suddenly. I am using Drupal 6.20.

My site worked fine before. i.e. at admin/build/block, the default theme is shown to let you rearranging blocks available, and when you click other tabs (with other theme's name), the page will be switched to that particular theme. But today suddenly I found that it does not work anymore. No matter what do you click, it also shows the Administrative Theme select (in my case it was Garland). This made me unable to change any block because my theme's regions are different from Garland's.

I had tried to set admin/build/block in the Administrative Theme module's setting to include it in the exceptional list (the Custom pages: Do not use administration theme on the following pages:), but it had no effect at all.

The only way I can access the block administrative page now is that I set the Administrative Theme to my own theme, then after I have done with the blocks, I change it back to Garland. This is really troublesome.

nlambert’s picture

General remark

You can use the context module for displaying and organizing drupal blocks. Moreover, this module allows you to turn off the block administration page (admin/build/block) as it "takes over" (in part) the functionality and also provides other very interesting features.

The context module appears within the admin theme.

Cheers

Baioroko’s picture

At the moment I have the same problem as described in #30 and #35. Yesterday everything was working fine. My custom sub-Zen theme was used if I was organizing blocks. But now it's just only using garland, my administrator theme.

Only thing changed since then was that i added a user role.

For now i use this link to access the right block editing page:

admin/build/block/list/YourThemeName

The links provided by drupal to change themes are not working for me either.

(This problem is accompanied by me that the off-line site message has no style sheet any more, it still had it yesterday. But i haven't looked into this problem yet)

lockwould’s picture

For those of you that have had this problem. I found a couple options for a work around.

first. get the context module.
It is a good option for managing content, especially blocks.
Its quite easy, just set a condition (ie a menu item or node type [pager to have it be shown on all pages])
then set a reaction, in this case 'block' what ever block you want to show and where.
(there are tutorials for context out there btw)

Secondly, for making new blocks, either go to admin/build/block/add
(when using this, make sure you have all the content for the block to begin with, otherwise you will be constantly adding and deleting blocks in order to update them, because you probably don't have access to the 'configure block' button when viewing the blocks configuration menu)

or get the CODblock module, or something similar. CODblock allows you to make basic html blocks.

there are probably many other modules that allow you to work around the problem. but these two have worked for me so far.

good luck.

(oh, this is all referenced form using drupal 6 by the way)

jessehs’s picture

I'm using the Context module for block placement. It's nice to have the admin/build/block page for easy access to view and edit all blocks, though. Here's the code I use to force the blocks admin page to use the admin theme (I'm using Rubik). I don't really know which variable matters, so I set them both. (I think the $theme variable is the important one.)


/**
 * Implementation of hook_init().
 */
function my_module_init() {
  // Hardcode the administration theme onto the blocks page
  if ($_GET['q'] == 'admin/build/block') {
    global $theme, $custom_theme;
    $custom_theme = variable_get('admin_theme', 'rubik');
    $theme = variable_get('admin_theme', 'rubik');
  }
}

EDIT: To clarify, this function goes inside your custom module "my_module" in the "my_module.module" file.

jessehs’s picture

Looks like that code I pasted in #39 actually can break the site in certain situations. I recommend against it!

emcniece’s picture

@jessehs, that #39 code is throwing an error for me: Fatal error: Unsupported operand types in /home1/jesusesm/public_html/hel/modules/block/block.admin.inc on line 39

I see that you say we shouldn't use it, but I'm desperate - is there any way we can get this to work?

bartclarkson’s picture

Nice tip on the Context module, jessehs. Thanks. I needed a good way to apply some blocks to all themes without stitching it into a module.

jami3z’s picture

I started getting this as well for an old drupal 6 site. I had the rubik theme installed and enable as the administration theme. All of a sudden the blocks page was not loading within my default site theme but within the rubik theme and I changing the block list (per theme) was doing nothing. After enabling the "Admin" module everything worked properly again.