如何创建页面模板?
所以,我一定错过了一些东西。 我想使用 Drupal 7 为基本页面创建一个特定的模板。我读过有关创建名为 page-mypagename.tpl.php 的文件并将其放入主题文件夹的内容,但这对我来说不起作用。 任何人都可以为此提供快速演练吗?
Drupal 让我头疼。 :\
谢谢。
So, I must be missing something.
I want to create a specific template for a Basic Page with Drupal 7. I've read about doing something like creating a file called page—mypagename.tpl.php, and putting it in the theme folder but this has not worked for me.
Can anyone provide a quick walk through for this?
Drupal makes my head hurt. :\
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保在主要主题更改后清除 Drupal 中的缓存,其中包括如上所述向主题添加文件,否则您的主题可能无法获取新文件。
最后我检查了一下,D7 的 Devel 模块仍然有问题,但如果它出现了,那么我强烈建议将其与 devel_themer 模块一起使用,它有一个工具可以告诉您为不同元素准确命名主题文件的名称(页面、节点、字段等)。
Make sure to clear your cache in Drupal after major theme changes which include adding files to the theme as above, otherwise your theme may not pick up the new files.
Last I checked, the Devel module was still buggy for D7, but if it has come along then I highly recommend using this along with the devel_themer module, it has a tool that will tell you what exactly to name your theme files for different elements (pages, nodes, fields, etc).