Drupal 7 开发内部培训资料, 分头诗人




function YOURMODULE_custom_theme() {
  if (ip_address() == '') {
    return 'THEME_NAME';

或者可以使用views的vid 做不同主题,也可以根据角色的不同而改变主题,还有很多很多需要自己慢慢摸索。。。非常强大好用的模块。赶紧试一下。">ThemeKey,ThemeKey Properties模块实现

Drupal 页面请求的处理过程

1. Someone fires a request to your webserver. They might get a cookie if they've already logged into the site.
2. The server gets the request. It goes to .htaccess which says everything should go to index.php
3. index.php loads the APIs and gets them ready to handle the request
4. The Menu API which was loaded looks up the paths that different modules have registered that they handle.
5. The module gets the request and fires hooks to see whether any module wants to help while it's building the page.
6. The module returns some info back to the menu system.
7. If the everything looks good, it figures out which theme is active and hands off the raw data to the theme layer.
8. That gets kicked back to Drupal.
9. That gets kicked back to the web server, which kicks it back to the user.

订阅 RSS - loveye007的博客