drupal - 以编程方式分配 drupal 主题

标签 drupal drupal-themes

我知道我们可以使用主题引擎将名为 page-name.tpl.php 的主题分配给名为/page/的页面。

如何在 drupal 中以编程方式将主题分配给模板?

最佳答案

global $custom_theme;
$custom_theme = 'garland';
init_theme();

关于drupal - 以编程方式分配 drupal 主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5186410/

相关文章:

drupal - 如何避免 Drupal7 View 在启动时显示结果?

php - Drupal:PDOException:SQLSTATE [HY000] [2002] 连接在 lock_may_be_available() 中被拒绝

php - 在 Drupal 7 中获取提交的帖子值

drupal - 如何使 Drupal 7 模块用完主题文件夹中的 .tpl.php 模板

drupal-7 - Drupal 7 : Modifying menu HTML output?

php - 用 PHP/Python 解析文本?如何?什么?

drupal - 使用选项卡创建 drupal 6 模块

drupal - 将 HTML 模板转换为 Drupal 7

javascript - 在 drupal 中自定义 Javascript 加载顺序并将新的 JS 添加到该列表

drupal - 如何摆脱 Drupal CSS 样式表?