【问题标题】:Need to have separate "complete" Drupal theme for each page on a site需要为站点上的每个页面设置单独的“完整”Drupal 主题
【发布时间】:2010-06-18 20:52:15
【问题描述】:

我想构建一个 Drupal 演示站点,我可以在其中创建多个自定义主题并将每个主题显示在站点的单独页面上。可以通过链接或菜单项访问。解决方案越“简单”越好。

【问题讨论】:

    标签: drupal-6 themes


    【解决方案1】:

    创建一个执行 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-15
      • 2016-09-18
      相关资源
      最近更新 更多