You are here

节点部分

g089h515r806 的头像
Submitted by g089h515r806 on 星期四, 2008-09-18 06:27

节点部分

xtemplate.xtmpl中的节点部分包含了页面的主内容,它的开始和结束标签如下:

<!-- BEGIN: node -->
<!-- END: node -->

 

{sticky}

如果节点被"stickied"(粘贴)到了列表的顶部(比如页面的teaser总是展示在首页的顶部),那么将css class(类)设为"node sticky"。如果节点没有被设为sticky的话,那么css class(类)设为"node "。

 

Picture 头像

头像就是代表节点作者的小图片,它将链接到作者的个人介绍页面上去。头像的开始和结束标签如下:

<!-- BEGIN: picture -->
<!-- END: picture -->

{picture}

比如可以输出以下内容:

<a href="user/1" title="View user profile.">

<img src="http://www.yoursite/files/pictures/picture-1.gif" alt="Username's picture" /></a>

 

Title(标题)

节点的标题,它的开始和结束标签如下:

<!-- BEGIN: title -->
<!-- END: title -->

在节点页面,标题的输出为:

<h1 class="title">Node Title</h1>

在drupal首页,每个节点标题的输出为:

<h2 class="title"><a href="node/31">Node Title</a></h2>

 

{link}

输出指向节点的链接,例如上面的"node/31"。

 

{title}

输出节点标题的文本,例如,上面的"Node Title"就是一个很好的例子。

 

{submitted}

节点的作者,发表时间等等,输出为:

Submitted by <a href="user/1" title="View user profile.">Username</a> on 16 February, 2004 - 23:46.

 

Taxonomy(分类)

节点所属的分类的链接,可以包含多个分类,它的开始和结束标签如下:

<!-- BEGIN: taxonomy -->
<!-- END: taxonomy -->

{taxonomy}

输出一个节点所属的分类术语(term):

<a href="taxonomy/term/30">Taxonomy Term</a>

 

{content}

节点的主内容。

 

Links(链接)

节点的一些可选项比如:"printer-friendly version"(适合打印的版本), "add new comment"(添加新评论),以及用户对节点的访问记录。它的开始和结束标签如下:

<!-- BEGIN: links -->
<!-- END: links -->

{links}

输出如下(取决于用户的权限):

<a href="book/print/8" title="Show a printer-friendly version of this book page and its sub-pages.">printer-friendly version</a> | <a href="comment/reply/8#comment" title="Share your thoughts and opinions related to this posting.">add new comment</a> | <a href="admin/statistics/log/node/8">662 reads</a>

 

相关链接: http://drupal.org/node/6754 , Think in Drupal

Drupal版本: