1

How do you set the theme for the edit page for just one content type on your site? I am using bootstrap for non-admin pages and using the default seven for the admin pages. So basically I need to override the admin theme of seven with the bootstrap theme, but only for one content type.

Any help is much appreciated.

1

Using hook_menu_alter you can override even the theme a path uses.

function hook_menu_alter( &$items)
{
    $items['path']['theme callback'] = 'variable_get';
    $items['path']['theme arguments'] = array('theme_default');
}

like this you set the theme for that path to whatever the user theme is, even for admins.

  • How would you do thus for an edit if a node because the path would be /node/{nodeid}/edit. You cant set a path. – Russ Apr 19 '14 at 3:24
  • 'node/%nid/edit'. When in doubt, you can look for the hook_menu of the module that declared the path you want work on. – Astrayus Apr 19 '14 at 8:25
1

Use Content Theme module to assign theme for content creating, editing, and viewing pages.

This module features are :

  • Assign a theme to all content. (This overrides the system default theme)

  • Assign a theme to a content type. (This overrides content wide themes and system default)

  • Assign a theme to a content node. (This overrides content type themes, content wide themes, and system default)

  • Allow to use different themes on content creating/editing pages than on viewing pages. Fine-grained permission control.

  • I appreciate the feedback, nothing seems to be working for overriding the seven them on the edit page. I loaded the content theme and it still did not change. When I debug it is showing boostrap sub theme being loaded first but then the seven theme loads last which I assume is causing this issue. Any ideas how to overcome this issue? – Russ Apr 19 '14 at 21:33
  • what seemed to work is setting the admin to default theme (bootstrap subtheme) and changing the theme for /admin/* to the seven theme. – Russ Apr 19 '14 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.