Using different templates for different nodes in Drupal 7(在 Drupal 7 中为不同的节点使用不同的模板)
问题描述
I am using Drupal 7. I want to add a template for a group of nodes. For example, If i have three nodes node/3, node/4, and node/5, I want to use a particular template. Is there a way to do that? If it is, How can i do that? Or What is the best alternate method?
Now I am using page.tpl.php template for all the pages except the front page.
There are many ways to do that.
For example you can place condition on node id in page.tpl.php.
Or you can use different templates for each node like here Template suggestions for page on specific node id and inside this templates you can include same template for each group using just include.
这篇关于在 Drupal 7 中为不同的节点使用不同的模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Drupal 7 中为不同的节点使用不同的模板


基础教程推荐
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何替换eregi() 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01