문제

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?

도움이 되었습니까?

해결책 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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top