如何组织Drupal模板?
我在修改主题(Acquia Prosper)时创建了一些自定义模板,我通常的做法是以这种方式放置所有模板:
主题名称/模板/页面/page-front.tpl.php
但这一次不太有效。所以我想知道为什么。我查看了 templates.php 寻找线索,但那里什么也没有。我使用这个组织的基本主题是 genesis,在该主题中它似乎有效,但在 Acquia Prosper 中无效。
有人能解释一下吗?
I created a few custom templates while modifying a theme (Acquia Prosper), and my usual practice is to put all my templates in this fashion:
theme-name/templates/page/page-front.tpl.php
But it didn't quite work this time. So I'm wondering why. I looked through the templates.php for a clue, but there is nothing there. My base theme where I used this organization was genesis, and in that theme it seems to work, but not in Acquia Prosper.
Can anyone shed some light on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的子主题中有 page.tpl.php 吗?
Do you have a page.tpl.php in your subtheme?
page.tpl.php 需要位于主题的根目录中,而不是位于子目录中。创建模板文件后,请确保刷新主题缓存,以便将文件添加到主题注册表中。
Devel、主题开发模块和管理菜单对于主题开发来说非常方便,所以如果您还没有安装它们,请安装它们。
page.tpl.php needs to be in the root of the theme, not in a subdirectory. Once you have created the template file, make sure you refresh the theme cache so that the file is added to the theme registry.
Devel, the theme developer module, and admin menu are really handy for theme development, so install those if you haven't already.