2

实际上,我需要知道每个 drupal 页面的页面内容是如何以及从哪里来的。所以我尝试将我自己的自定义主题集成到drupal。在教程中,他们说我需要创建一个自定义文件夹并将默认主题之一(如 garland/pushbutton)复制到该文件夹​​。我得到了正确的结果,但是当我检查这些模板中的文件和函数时,用于创建模板的函数是不同的。例如,在 pusbutton 主题中,我们没有 template.php,但在 garland 中,我们必须有一个 template.php 文件来显示内容。所以我很困惑,drupal 是否没有标准的方式或功能或文件来创建自定义模板?还有数据是如何出现在每一页的?

4

1 回答 1

1

复制现有的核心主题文件夹并放入 /sites/all/themes 是一个很好的做法。drupal 中的每个主题都彼此不同。例如template.php使用

For all the conditional logic and data processing of the output, there is the template.php file. It is not required, but to keep the .tpl.php files tidy it can be used to hold preprocessors for generating variables before they are merged with the markup inside .tpl.php files.

创建主题所需的唯一文件是.info文件。

详细了解主题的工作原理

于 2013-05-03T06:36:36.370 回答