Skip to main content

Questions tagged [theme-negotiation]

Filter by
Sorted by
Tagged with
0 votes
2 answers
176 views

How can I ensure external links open in a new tab?

I recently had to solve a problem where my theme was preventing the attributes of a menu link from displaying. I didn't know the problem at first. I problem solved first by trying various modules and ...
Mark P's user avatar
  • 20
1 vote
1 answer
72 views

Set admin theme by user

Is it possible to set a different admin theme by user ? I found this old module https://www.drupal.org/project/tbr it's probably possible to convert it to fit the new Drupal 8/10 system (https://www....
Etienne's user avatar
  • 335
1 vote
1 answer
354 views

Custom Menu Template not Rendering Menu Links

I'm building a custom module that modifies the main theme (barrio bootstrap in this case) to establish a landing page. In that process, it hides blocks in some regions and takes over rendering the ...
micbay's user avatar
  • 33
1 vote
1 answer
336 views

Override contrib module's template for an admin module

I need to override a contrib module's template for an admin module. For example, the webform_composite module has hook_theme() in its module file. /** * Implements hook_theme(). */ function ...
esod's user avatar
  • 329
0 votes
1 answer
143 views

Use specific theme [not template file] for 404 and 403 generated for specific path

I have 2 themes, both enabled, assume they are called my_first_theme (default) and my_second_theme. I have /whatever path and lots of the pages under this path, and I have a theme negotiator, which ...
Alex Smirnoff's user avatar
0 votes
0 answers
285 views

How to get node information in RouteSubscriberBase::alterRoutes

what I'm trying to achieve is, for some specific nodes, to set the admin theme. How can I get node information in this class? class RouteSubscriber extends RouteSubscriberBase { /** * {@...
Bohus Ulrych's user avatar
0 votes
1 answer
59 views

Specify the theme when creating content / importing content via Feeds

I want to force all content to be created using my primary site theme. I want to do this because I am using a renderer in MYMODULE_node_presave() like this: function MYMODULE_node_presave(...
Patrick Kenny's user avatar
0 votes
1 answer
451 views

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 ...
Joost's user avatar
  • 1,378
0 votes
1 answer
17 views

Template suggestions periodically not being recognized

I have some simple template suggestions setup in my THEME_preprocess_node() function. Example: function my_theme_preprocess_node(&$vars) { if ($vars['node']->type == 'MY_TYPE' && $...
Micah's user avatar
  • 95
0 votes
0 answers
138 views

Dynamically set theme per block/paragraph

I'm looking to apply specific themes to individual items on a page - a different theme to the rest of the page. I realise this seems quite obscure, but the general premise is similar to a styleguide. ...
mediaashley's user avatar
  • 1,104
2 votes
1 answer
80 views

Switch theme by http status code

We have a page that uses several themes, but the 404 pages should all look the same. So, for all themes except one we need a rule that switches to another theme when the URL does not match any ...
Philipp Zedler's user avatar
0 votes
1 answer
1k views

Alternatives to themekey? [duplicate]

I need to show my website with a "theme" when in header's requests is present a particular key/value. In Drupal 7 I do this via themekey, but this module does not exist in Drupal 8. Are there ...
ZioBudda's user avatar
  • 1,182
1 vote
0 answers
170 views

How to change active theme based on taxonomy?

I have a situation where I need to change the active theme based on whether the current entity has a certain taxonomy tag. So when an entity is viewed and tagged with candy, I would like the Candy ...
Forrest Brownlie's user avatar
0 votes
2 answers
3k views

How do I programmatically change the admin theme?

How do I define a different administration theme for a user and administration role in Drupal 8? I have looked at the context module for Drupal 8. There is a problem with the context condition and ...
Antoon Verroken's user avatar
2 votes
1 answer
196 views

How to resolve the negotiated theme for any other user?

I have found How can I programmatically get the theme name?, which works for the current user, but would I apply such logic to learn what theme another user would use? I can get the active theme for ...
Neograph734's user avatar
  • 8,449
0 votes
1 answer
95 views

Different Theme for Current URL - Using Javascript?

I know that you can have different themes for different parts of the site, assigning specific URLs to different themes by using hook_custom_theme() or the themekey module - I've used both solutions to ...
dubesor's user avatar
  • 175
-1 votes
1 answer
85 views

How can I change a theme for a specific module?

I am new to Drupal, I want to change a theme for a particular module (private message module) current look and feel is not pretty. I am planning to put a "Garland" theme for Private message module. ...
sai vijay's user avatar
0 votes
1 answer
97 views

ThemeKey rule; how to target IMCE pages

On my Drupal 7 site, I noticed that the IMCE popup loses its action buttons and all functionality when I'm using Adminimal as the admin theme: In the Known Issues section of the IMCE project page, ...
Sam's user avatar
  • 835
1 vote
1 answer
1k views

What are the criteria to decide between modules ThemeKey and Switchtheme?

There are (at least) 2 modules that allow for switching between themes, i.e.: ThemeKey. Switchtheme. What are the typical criteria, or pros/cons, for a site builder (without any custom coding or ...
Pierre.Vriens's user avatar
1 vote
0 answers
30 views

Switching theme for comments as well as nodes (ThemeKey?)

I'm building a site based on Advanced Forum. I need each forum to display a different theme. ThemeKey does this so nicely with a trigger for which forum taxonomy is in effect, but does not seem to ...
user47773's user avatar
0 votes
1 answer
340 views

ThemeKey: Use main theme for Node/edit and user/edit

By default, Drupal uses the "main theme" for the main site, and the "admin theme" for the admin pages. I want to use my "main theme" for the user/edit pages and node/edit & node/add pages of the "...
big_smile's user avatar
  • 2,838
1 vote
1 answer
364 views

Themekey with mobile detect not working properly

I am using themekey module with mobile detect module for switching mobile and desktop version of themes. Some time it works and some time not. On Apple devices it load the mobile version. I'm ...
Fawad's user avatar
  • 51
0 votes
1 answer
191 views

admin theme changes to default at editing page, Themekey module

Using the ThemeKey module, I have changed the theme of user role (EDITOR) to Administration theme. So, when the user of this role logs in, he gets admin theme. It works find but when he edit ...
Suresh's user avatar
  • 73
0 votes
2 answers
975 views

explicit "switch to mobile theme" link with Theme Key

I'm using Theme Key https://www.drupal.org/project/themekey to switch automatically between themes dependent on browser and/or OS id. Now I would like to allow the user to explicitly switch to or ...
stdcerr's user avatar
  • 511
0 votes
1 answer
214 views

Site with Themekey has CSS cross-contamination

I'm using Themekey with Context to enable one of three different themes on a site, depending on a themekey field. The homepage is set to use my main theme, called 'sitetheme'. Sitetheme is set as ...
beth's user avatar
  • 9,087
1 vote
1 answer
228 views

Themekey & Organic Groups

I have a case scenario in which different organic groups can have different themes. Using "Themekey" I allow the user to select a theme when the group node is created and it works fine. When the user ...
Ahmed Jabar's user avatar
1 vote
1 answer
296 views

Does "Boost" module work together with "Theme Key" module?

I wonder if the Boost module works together with the ThemeKey module. Has anyone experience with both modules working together? Especially when it comes to different style-sheets for different ...
Volker's user avatar
  • 1,370
0 votes
1 answer
100 views

How can I change active theme for specific paths or inside module? [closed]

I'm working on an online game engine website where users can create games online and other can play it. All pages are displayed in normal theme except game play page which should be in full screen ...
Mohammad Ali Akbari's user avatar