drupal主题执行流程
我是 drupal 的初学者,对它了解不多,我对 drupal 主题作品感到惊讶。我想知道 drupal 主题的执行流程。如果我打开主题文件夹...,有一个文件,如 page.tpl、template.tpl、node.tpl 等... drupal 按顺序读取所有这些主题文件...
I am beginner to drupal and doesn't know more about it I am amazing about drupal theme works. And I would like know drupal theme's flow of execution. If i open theme folder..., there is a file like page.tpl, template.tpl,node.tpl and more... In which order the drupal reads all those theming file...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有简单的答案,这实际上取决于情况。
Drupal 主题系统的特点是它非常灵活,这意味着在某些情况下您可以让它使用默认模板之外的其他模板。
您通常唯一可以确定的是,使用了
page.tpl.php
,它定义了页面的主要结构。它通常定义可以放置动态内容的不同区域。该内容可以通过模板和主题功能的组合来生成。如果您想了解这一切是如何工作的,您可以尝试阅读主题指南,或者了解更多信息实际操作方法是,安装主题开发模块来检查 drupal 页面的不同元素。
There is no easy answer, it really depends.
The thing with Drupal's theming system, is that it is very flexible, which means, that under certain situations you can make it use other templates, than the default.
The only thing you usually can be sure of, is that the
page.tpl.php
is used, it defines the main structure of the page. It usually defines different regions where you can put dynamic content. This content can be generated by a combination of templates and theme functions.If you want to understand how this all works, you could try to read the theme guide, or for a more hands on approach, install the Theme developer module to inspect the different elements of a drupal page.
Nick Lewis 一如既往地在这里写了一篇关于主题内部的精彩文章,此处,以及此处。它们中没有一个能够为您提供完整的概述,但是它们三者一起创造了协同作用的 drupal 的强大功能。
Nick Lewis, as always, has a well written piece about the theming internals here, here, and here. Not one of them gives you the complete overview, but the three of them together creates synergistic drupal awesomeness.