简体   繁体   English

Drupal 7:如何命名没有节点ID的节点模板?

[英]Drupal 7: how to name the node template without node id?

I am new to Drupal 7. I want to create a template file for node of page content type. 我是Drupal 7的新手。我想为页面内容类型的节点创建模板文件。 I have created a template file with name page--node--node_id as per the drupal 7 and that page also loaded. 我已经按照drupal 7创建了一个名为page--node--node_id的模板文件,该页面也已加载。

But the problem is id will be different in each environment, so can you give me suggestion for http://example.com/members/high-school , what name should i give for that page node? 但是问题是id在每个环境中都会有所不同,所以您可以给我有关http://example.com/members/high-school的建议,我应该为该页面节点命名吗? can I give name using url to that file? 我可以使用该文件的网址来命名吗?

I tried with page--members-high-school, page--node--members-high-school but its not loading. 我尝试了页面-成员高中,页面-节点-成员高中,但未加载。

If your content type is "page", name your template node--page.tpl.php . 如果您的内容类型为“ page”,则将模板node--page.tpl.php命名为node--page.tpl.php

You can also read this very interesting article about template hook suggestion: https://drupal.org/node/1089656 您还可以阅读有关模板挂钩建议的这篇非常有趣的文章: https : //drupal.org/node/1089656

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM