简体   繁体   English

Drupal 7默认节点“查看”模板

[英]Drupal 7 Default Node “View” Template

I am working on Drupal 7.23. 我正在研究Drupal 7.23。 I would like to know if there is a way to modify the node template when viewed. 我想知道查看时是否有修改节点模板的方法。 I am NOT trying to change it on the main page or when searched by tags or any other means. 我不会尝试在主页上或通过标签或任何其他方式搜索时进行更改。 I am trying to change the view or display when a node is selected. 我试图在选择节点时更改视图或显示。

Usually there are 2 tabs for any node or content_type ie "view" and "edit". 通常,任何节点或content_type都有2个标签,即“视图”和“编辑”。 I need to change the template for "view". 我需要更改“视图”的模板。 Thank you. 谢谢。

Zain Zain

By default, Drupal provides two display modes for nodes: default and teaser. 默认情况下,Drupal为节点提供两种显示模式:默认和预告片。 Both these view modes are generally rendered using node.tpl.php. 这两种视图模式通常都是使用node.tpl.php呈现的。 Either modify this file to fit your needs or use hook_theme_suggestions() to create separate tpl files for different views. 修改此文件以满足您的需要,或者使用hook_theme_suggestions()为不同的视图创建单独的tpl文件。

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

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