As discussed with the management menu (http://drupal.org/node/511258#comment-1865594) and elsewhere, shipping with a core admin theme requires us to think about node submission on the UI. Some node types (forums usually, but many other types on sites) should be submitted with the site theme, while admin-only types (let's say static pages) are submitted with the admin theme (and eventually consequently the overlay).

So I've made the node admin theme setting per content type with a default of 1 (which was our new default installation setting already). Added upgrade path, so that existing sites will get the global setting migrated to the per-type setting.

An interesting side effect is that now node/add is not themed with the admin theme, since we don't know whether the user is about to post an "admin" or a "user" node type. The overlay might need some trickery to still display this in the admin theme if/until the content type selector is not displayed on the node form itself.

CommentFileSizeAuthor
admin-theme-node-type.patch9.21 KBGábor Hojtsy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch failed testing.

joshmiller’s picture

Status: Needs work » Needs review

Interesting solution. Can we make this a multi-valued type so that I could hook into it in contrib and make my own type of content type?

I wonder if the bot is broken or HEAD is broken? Can't hurt to try the bot one more time...

Josh

David_Rothstein’s picture

I'm not sure if this is a good idea or not. Copying what I wrote at http://drupal.org/node/511258#comment-1873964:

Although I realize the implementation details might be particularly tricky, I honestly think the ideal thing to do here is that it depends where you clicked from. If you're in the overlay and click on a create content link within that, I think you should stay in the overlay/admin theme. Whereas if you're on the "main site" and click such a link, I think you should stay in the main site theme.

I honestly don't think the content type matters much. Just because I have forums on my site that regular users can submit to doesn't necessarily mean that I, as a site administrator, automatically want to go into "regular user mode" every time I myself submit a forum post.

Also, as discussed in that issue, we need to keep in mind how this will interact with things like the (proposed) Create Content block. If there are per-content-type settings for this, it is going to get tricky to figure out what links show in that block and what links don't - and whether you "jump themes" when you click on a link, etc.

All in all, sounds like a fun issue :)

Gábor Hojtsy’s picture

@David: you'd not only jump themes but also jump to the overlay if you are about to create an admin theme. The D7 concept is to have a clear indication of "where you are" on the site, and having admin UIs both in the admin theme/overlay and outside the admin theme/overlay can be quite confusing IMHO.

I totally agree that it can also be confusing to only have a list of content items on the front end which are about to be submitted on the front end and vice versa only admin content items on the admin UI, so we need to somehow figure out the interaction, but I'd say just determining the overlay/theme by the start of the interaction point is not going to work and going to be more confusing.

David_Rothstein’s picture

Note that I have a patch at #553944: Define hook_menu_get_item_alter() as a reliable hook that runs before the page is doomed which started off as an attempt to fix a totally unrelated bug, but might be useful for this issue too since it would make granular per-page theming a fair amount easier.

I still sort of like the idea of having it depend on where you clicked from, since I think that is the only solution that would really minimize the "jumping" between the overlay and non-overlay (without restricting which links can appear where).

However, another solution which might be worth thinking about would be to make it depend on a permission. So "regular users" adding content would see it in the main site theme, while "admin users" would see it in the overlay. This would solve the problem of having to have two different lists of content types - each individual user would have consistent behavior for any content creation/editing link they clicked on, so they could all appear in the same list. However, it would also mean that an admin user wouldn't be able to experience content creation via the same screen that a regular user would.

Noyz’s picture

I like where David is going here. The experience should be uniform across users. Having "add" take on two different interfaces would cause confusion. If you can do this by role, at least the admin will always have the same experience until he logs out.

Gábor Hojtsy’s picture

This is still a problem. Currently, if you have forum topic creation permissions for regular users, they'll see the Seven theme on the node creation page when submitting forum topics as far as I've seen.

David_Rothstein’s picture

This is still a problem. Currently, if you have forum topic creation permissions for regular users, they'll see the Seven theme on the node creation page when submitting forum topics as far as I've seen.

Yes, this is a feature of the node admin theme setting (in D6 too I think?) which makes it not useful for a large number of sites :)

If it comes down to it, we could probably just stop turning that setting on in the standard install profile in D7, since when all is said and done the overlay is going to handle its own theming anyway (it's only different now due to a bug).

See also #669510: Merge administration theme with hook_admin_paths() where there is an effort underway to do something similar to what I mentioned above (i.e. move the entire admin theme in Drupal 7 to be permission-based in addition to page-based), which would solve this problem completely as well.

retester2010’s picture

Issue tags: -Usability, -D7UX

admin-theme-node-type.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, admin-theme-node-type.patch, failed testing.

chx’s picture

Version: 7.x-dev » 8.2.x-dev
Issue summary: View changes

BUMP. As far as I can see this is still a problem. Is the community still interested? This would require

  1. A config schema change
  2. A change to NodeTypeForm
  3. A new service tagged with theme_negotiator
Gábor Hojtsy’s picture

I think this would still be really nice. Not sure of the exact config schema change policy, but I think as long as it is backwards compatible, it should be fine.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.