Drupal 6.x核心的node.tpl.php默认可用变量描述
所在目录:modules/node/node.tpl.php
/**
* @file node.tpl.php
*
* 节点的主题化输出。
*
* 可用变量:
* - $title: 节点标题(sanitized)。
* - $content: 节点内容或摘要。原文:Node body or teaser depending on $teaser flag.
* - $picture: 来自theme_user_picture()的作者头像输出。
* - $date: 格式化的创建日期(use $created to reformat with format_date())。
* - $links: 如“阅读全文”、“添加新评论”等等来自from theme_links()的输出。
* - $name: 来自theme_username()的节点作者用户名的输出。
* - $node_url: 当前节点的url。
* - $terms: 来自heme_links()的分类(taxonomy term)链接输出
* - $submitted: 来自theme_node_submitted()的发表信息输出。
*
* 其他变量:
* - $node: 完整节点对象。包含的数据可能不安全。
* - $type: 节点类型,例如 story、page、blog等等。
* - $comment_count: 此节点的评论数。
* - $uid: 此节点作者的用户ID。
* - $created: 此节点发表时间(Unix时间戳)。
* - $zebra: 输出“even”或“odd”。可用于摘要列表的奇偶行样式控制。
* - $id: Position of the node. Increments each time it's output.
*
* 节点状态变量:
* - $teaser: 摘要标识。(原文:Flag for the teaser state.)
* - $page: 完整页面标识。(原文:Flag for the full page state.)
* - $promote: 推荐到首页标识。(原文:Flag for front page promotion state.)
* - $sticky: 置顶文章标识。(原文:Flags for sticky post setting.)
* - $status: 发布状态标识。(原文:Flag for published status.)
* - $comment: 此节点评论设置状态标识。(原文:State of comment settings for the node.)
* - $readmore: 如果此节点的摘要内容未完全显示全部节点内容标识为真。(原文:Flags true if the teaser content of the node cannot hold the main body content.)
* - $is_front: 如果被提交到首页标识为真。(原文:Flags true when presented in the front page.)
* - $logged_in: 如果当前用户为已登录用户标识为真。(原文:Flags true when the current user is a logged-in member.)
* - $is_admin: 如果当前用户为站点管理员标识为真。(原文:Flags true when the current user is an administrator.)
*
* @see template_preprocess()
* @see template_preprocess_node()
*/
* @file node.tpl.php
*
* 节点的主题化输出。
*
* 可用变量:
* - $title: 节点标题(sanitized)。
* - $content: 节点内容或摘要。原文:Node body or teaser depending on $teaser flag.
* - $picture: 来自theme_user_picture()的作者头像输出。
* - $date: 格式化的创建日期(use $created to reformat with format_date())。
* - $links: 如“阅读全文”、“添加新评论”等等来自from theme_links()的输出。
* - $name: 来自theme_username()的节点作者用户名的输出。
* - $node_url: 当前节点的url。
* - $terms: 来自heme_links()的分类(taxonomy term)链接输出
* - $submitted: 来自theme_node_submitted()的发表信息输出。
*
* 其他变量:
* - $node: 完整节点对象。包含的数据可能不安全。
* - $type: 节点类型,例如 story、page、blog等等。
* - $comment_count: 此节点的评论数。
* - $uid: 此节点作者的用户ID。
* - $created: 此节点发表时间(Unix时间戳)。
* - $zebra: 输出“even”或“odd”。可用于摘要列表的奇偶行样式控制。
* - $id: Position of the node. Increments each time it's output.
*
* 节点状态变量:
* - $teaser: 摘要标识。(原文:Flag for the teaser state.)
* - $page: 完整页面标识。(原文:Flag for the full page state.)
* - $promote: 推荐到首页标识。(原文:Flag for front page promotion state.)
* - $sticky: 置顶文章标识。(原文:Flags for sticky post setting.)
* - $status: 发布状态标识。(原文:Flag for published status.)
* - $comment: 此节点评论设置状态标识。(原文:State of comment settings for the node.)
* - $readmore: 如果此节点的摘要内容未完全显示全部节点内容标识为真。(原文:Flags true if the teaser content of the node cannot hold the main body content.)
* - $is_front: 如果被提交到首页标识为真。(原文:Flags true when presented in the front page.)
* - $logged_in: 如果当前用户为已登录用户标识为真。(原文:Flags true when the current user is a logged-in member.)
* - $is_admin: 如果当前用户为站点管理员标识为真。(原文:Flags true when the current user is an administrator.)
*
* @see template_preprocess()
* @see template_preprocess_node()
*/









这些变量我还是没有真正的研究过,准确的说,没有见过的,都是
这些变量我还是没有真正的研究过,准确的说,没有见过的,都是用现成的模块,没有修改过代码的
华宇物流
还请教一个问题,是不是只有page类的页面才会有node.
还请教一个问题,是不是只有page类的页面才会有node.tpl.php呢,我在相册使用dev却看不到有node.tpl.php,你的教材以是以“关于我”例的
不是,node.tpl是针对所有内容类型的,可能是你用de
不是,node.tpl是针对所有内容类型的,可能是你用devel themer点击的时候没有点到合适的地方:)
发表新评论