Question

I tried using hook_custom_theme to change the theme for the node add page for a specific content type, like this, without success:

function mymodule_custom_theme() {
  if (current_path() == 'node/add/mytype')
    return 'anothertheme';
}

I know the function is running, and I know the comparison is returning TRUE. Why is it not working?

Was it helpful?

Solution 2

1) Do you use the correct machine name for the theme?

2) Are you sure that there are not other modules to override this later?

3) Is the page cached? If so this may not work properly.

Same question and discussion here: https://drupal.stackexchange.com/questions/812/how-do-i-change-a-theme-based-on-the-url

Useful modules:Page Theme, Context, ThemeKey.

OTHER TIPS

I think you are not writing the theme name correctly.

But there is a module which could do this work for you: https://drupal.org/project/themekey

Regards.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top