【发布时间】:2010-06-18 20:52:15
【问题描述】:
我想构建一个 Drupal 演示站点,我可以在其中创建多个自定义主题并将每个主题显示在站点的单独页面上。可以通过链接或菜单项访问。解决方案越“简单”越好。
【问题讨论】:
我想构建一个 Drupal 演示站点,我可以在其中创建多个自定义主题并将每个主题显示在站点的单独页面上。可以通过链接或菜单项访问。解决方案越“简单”越好。
【问题讨论】:
创建一个执行 PHP 代码的自定义块。下面的代码 sn -p 应该在$custom_theme 中设置的主题中显示当前页面。
global $custom_theme, $theme;
// If $theme is set, init_theme() will not initialize the custom theme.
unset($theme);
// Set the theme you want to use.
$custom_theme = "garland";
init_theme();
还有一个模块允许您根据一些规则(例如,显示的内容类型、正在查看的页面的 URL 等)更改使用的主题:项目页面是http://drupal.org/project/themekey。
【讨论】: