11月
30

2007

Txp:author

Classification -类型

The author tag is a Single Tag which is used to return the name of the author of the currently displayed article. Its context is an aricle form.
author标签是一个独立标签,用来返回相应文章的作者,根据上下文的内容显示相应的作者,比如多用户时候,a发表的文章显示作者是a,b发布的显示作者是b。

Syntax-语法

The author tag has the following syntactic structure…
该标签的语法如下:

<txp:author />

Attributes -属性

Tag will accept the following attributes (case-sensitive):
这个标签接受以下属性(属性区分大小写):

  • link=“boolean”

Make text a link to author’s posts. Available values: 0 (no) or 1 (yes). Default is 0 (no).
作者名称是否用链接显示,如果用链接显示,将会把作者名称连接到其文章列表。属性值为1或者0

  • section=“section_name”

Only link to articles from the named section. Default is unset.
链接到作者文章列表是否只显示某一个版面下的文章,没有预设值。

  • this_section=“boolean”

Only link to articles from the same section as the current article’s. Available values: 1 (yes) or 0 (no). Default is 0 (no).
只链接到该文章对应的当前版面下的文章。属性值为1或者0,预设值是0.

Examples -例子

Example 1: As a linked element in an article Form
在文章模块内显示作者的链接。

An article form can be created any way you want it by using a combination of article-related Tags. Following is just one possibility:
利用这些标签,你可以随意的创建你的模块,下面只是一种简单的应用。

<h1><txp:title /></h1>

<p class="author-date">Posted By: <txp:author link="1" /> <txp:posted /></p>

Tags used: <txp:posted />, <txp:title />

本文评论功能已关闭。