ThemeNegotiator not working for admin pages I'm trying to use the ThemeNegotiator to change the theme of the add and edit pages of one content type. I've followed the following very extensive posts/blogs.

Don't use admin theme for adding editing specific content type

Dynamic theme switching in Drupal 8

Soft launching your new drupal theme

Choose your theme dynamically Drupal 8

I have a user that is allowed to see the Admin theme seven, but for one content type documenten I want him to see the front-end theme svds. I'm able to get this to work for front-end pages but not for admin pages. What I think is that the applies part doesn't match on the add and edit pages. So it doesn't know it's on a documenten content type. Does anyone has an idea on how to solve this?

Module structure:

theme_switcher
--src
----Theme
------SwitcherNegotiator.php
--theme_switcher.info.yml
--theme_switcher.services.yml


theme_switcher.info.yml:

name: Theme Switcher
type: module
description: 'Switch theme for specific Content Type'
package: SVDS
core: 8.x


theme_switcher.services.yml:

services:
    theme.negotiator.theme_switcher:
        class: Drupal\theme_switcher\Theme\SwitcherNegotiator
        tags:
          - { name: theme_negotiator, priority: -50 }


SwitcherNegotiator.php:

&lt;?php
/**
 * @file
 * Contains \Drupal\theme_switcher\Theme\SwitcherNegotiator
 */

namespace Drupal\theme_switcher\Theme;

use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Theme\ThemeNegotiatorInterface;

class SwitcherNegotiator implements ThemeNegotiatorInterface
{
    /**
     * {@inheritdoc}
     */
    public function applies(RouteMatchInterface $route_match)
    {
        // Use this theme on a certain route.
        $node = $route_match-&gt;getParameter('node');
        if (!is_null($node) &amp;&amp; $node instanceof \Drupal\node\Entity\Node) {
            return $node-&gt;getType() == 'documenten';
        }

        // apply default theme
        return false;
    }

    /**
     * {@inheritdoc}
     */
    public function determineActiveTheme(RouteMatchInterface $route_match)
    {
        // Here you return the actual theme name.
        return 'svds';
    }
}
The admin theme negotiator is tagged with a priority of -40:

user.services.yml

  theme.negotiator.admin_theme:
    class: Drupal\user\Theme\AdminNegotiator
    arguments: ['@current_user', '@config.factory', '@entity_type.manager', '@router.admin_context']
    tags:
      - { name: theme_negotiator, priority: -40 }


So you have to use at least -39, since the first negotiator returning a theme name wins and on an admin page this core service will return the admin theme.