I'm trying to stop my blocks admin pages from being rendered in the admin theme (garland) since this is causing me no end of hassle having to re-assign blocks to my custom theme's region (based on the 'basic' theme).

admin_theme doesn't pay any attention to paths I put into the

"Do not use administration theme on the following pages.:"

section.

I've tried to exclude the following paths. . .

  • admin/build/block
  • /admin/build/block
  • admin/build/block*
  • /admin/build/block*
  • admin/build/block/*
  • /admin/build/block/*

. . . nothing works to stop the blocks admin pages from being rendered in the admin theme.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

davyvdb’s picture

Assigned: Unassigned » davyvdb
Status: Active » Closed (duplicate)
austintnacious’s picture

Status: Closed (duplicate) » Active

Hi Davy!

This is NOT a duplicate, in fact its an exact opposite.
The comment you referred me to is requesting as a feature what I am describing as a problem.
The thread you refer to does not describe a fix for my problem!

I want to be able to use admin_theme for most of my admin pages but want to render my blocks page in my custom theme.
My custom theme (based on "Basic") and my admin theme (Garland) have different drupal regions.

If I try to EXCLUDE my blocks admin pages from the admin theme, using admin_theme.module's exclude text field the paths I enter are ignored. . . that is my blocks admin pages are rendered in the admin theme not my custom theme.

davyvdb’s picture

This is only true on admin/... pages. It has to do with this issue : http://drupal.org/node/508536

Now core administration theme feature can take over again.

Since I fixed that one, this one's in. Let me think about how to solve this.

davyvdb’s picture

How about


  // we should not show the admin theme if the user has no access or the path is in the disallow list
  if (!user_access('access admin theme') || $admin_theme_disallow) {
    global $custom_theme;
    if ($custom_theme == variable_get('admin_theme', '0')) {
      $custom_theme = '0';
    }
    else {
      unset($custom_theme);
    }
    return;
  }

austintnacious’s picture

Hi Davy!

I'm not a programmer so I can't really help you in terms of how good the code is.

If you present it in patch form I'll be happy to manually patch admin_theme and let you know if it works for me. . . but without the patch format I don't know what to do with the code snippet you've provided. . .

Thanks!

codesmith’s picture

I'm having this same problem with the theme for add/edit forum topics. I want to use the admin theme for add/edit *except* for forum pages. I've tried *forum*, forum/*, and others but doesn't work. So seems to be bigger than just admin/ unless I'm missing something.

And actually 'access admin theme' isn't even turned on for the user role I was testing with so they shouldn't be getting the admin theme anyway, right?

davyvdb’s picture

Indeed. It's on the default Drupal administration theme paths. Content editing en admin/ pages.

davyvdb’s picture

FileSize
820 bytes

Patch.

vlooivlerke’s picture

Same Problem

Want to exclude admin/build/blocks
But it does not do its job

This work perfect in 1.1 and I had to revert back on my production site.

I have a role "admin" with the right to access admin theme and blocks

Blocks are theme specific and if you keep seeing the admin theme when administering blocks you will only be able to manage the admin theme block regions.

By default the admin theme should not be enabled when managing blocks

davyvdb’s picture

FileSize
699 bytes

@VlooiVerke : Have you applied the patch?

Provided is a new patch based on http://us2.php.net/manual/en/function.unset.php

Unsetting global variables only works for the local instance. To unset them you should use $_GLOBALS.

Have a look at this patch and tell me what you think.

vlooivlerke’s picture

cool Patch works

Thanks

vlooivlerke’s picture

Spoke too soon

Now if i go to admin/build/blocks a see my first block theme "Garland"

But if a go to the next theme minelli (build/block/list/minnelli) it shows the "garland" theme

I turned on over 6 themes and never mind where I click on block management per theme (build/block/list/*theme) it keeps showing garland

Both patches dont work and give the same effect as described above

davyvdb’s picture

Alright. So this is another issue.

Let me repeat : "Your admin theme is garland, your default theme is something else. If you go to admin/buidl/block for your default theme, the admin theme is appearing." How have you configured admin theme? Have you installed any other modules that mingle with themes? Because I can not reproduce this.

vlooivlerke’s picture

My installation

Admin theme "Basic"

Other active themes "Garland" and "minelli" and "4 more themes"

Admin theme settings:
Do not use administration theme on the following pages.:
admin/build/block
admin/build/block/list/*

Now

When i visit admin/build/blocks it shows the first theme "Garland" and not my "Basic admin theme" cool, but not coz if i visit the next active theme minelli (admin/build/list/minelli) it keeps showing "garland" and it will show garland for all

davyvdb’s picture

Can you remove?

Do not use administration theme on the following pages.:
admin/build/block
admin/build/block/list/*

That should not be necessary.

vlooivlerke’s picture

Now it shows my "basic admin theme" on all admin/build/block pages

davyvdb’s picture

You have any other modules doing something with themes? Do you mind sending me a zip/tarball with all the code of your installation?

vlooivlerke’s picture

The only theme related i can think off is

Rootcandy Admin theme

Region Manager

Hope this helps

davyvdb’s picture

Category: bug » support
Status: Active » Closed (won't fix)

I've installed Region Manager and I can reproduce the bug now. I can even remove admininistration theme and I still have the bug. This module is calling init_theme. So this is a bug in this module.

vlooivlerke’s picture

Posted bug report here for Region Manager: http://drupal.org/node/465052#comment-1951920

q0rban’s picture

Davy, thank you for putting the time in testing this, but I'm confused. How is calling init_theme() a bug?

davyvdb’s picture

Well, I've checked it out. Removing init_theme from your module solved the issue with the block administration page here described. Maybe you should check with the theme system writers?

codesmith’s picture

554324-2.patch solved my problem. If path is in exclude list, default theme is shown. If user does not have 'access admin theme' permission, default theme is shown. Many thanks.

chriscalip’s picture

Maybe this would help .. i usually just make a page-admin-build-block.tpl.php on the default theme...

Melissamcewen’s picture

Did this patch ever get committed? I am have this problem and I'm not using region manager.

Melissamcewen’s picture

Status: Closed (won't fix) » Active
B-Prod’s picture

Version: 6.x-1.2 » 7.x-1.x-dev
Category: support » bug
Priority: Normal » Critical
Status: Active » Needs review
FileSize
586 bytes

Actually the disallowed paths are ignored when using the short URL. The patch below fixes such issue.

For those who do not want the admin theme to appear on node/*/edit or node/*/revisions pages, take care to not check "Content editing" option, because the system module will take over the administration theme module.

brad.bulger’s picture

Issue summary: View changes

This last patch doesn't work for me, but the one in #1227704: Cannot set admin theme to not show for user page does.