六
9月
29
2007
Txp:article custom
Classification-分类/类别
The article_custom tag is a Single_Tag which provides a variety of custom options for article sorting, selecting, and display.
Textpattern will replace this tag with one or more articles.
article_custom标签是一个独立的标签,他为用户提供大量的文章分类、选择和显示的选项。textpattern可以在一篇或者多篇文章中替换这个标签。
Unlike < Txp:article_/ >, article_custom will always return an article list, and is not context-sensitive. This means that, while < Txp:article_/ > can only see posts within the currently viewed section/category/author, etc, article_custom can see all posts from all sections, categories and authors, unless you restrict it via attributes (see below), and that context-sensitive navigation tags, such as “txp:older” and “txp:newer”, will not work.
不像Txp:article标签一样,article_custom会总是返回到文章列表,而且没有上下文的关联。也就是说,Txp:article只能看到当前页面属性下的文章,比如某个版块,某个分类,或者某个作者的文章,而article_custom就可以看到所有的文章,没有文章关联的限制,但是文章导航的旧的文章“txp:older”和新的文章“txp:newer”标签就无法使用了。
A comparison of how article and article_custom differ .
Related Info: Customizing txp:recent_articles .
Syntax -语法
The article_custom tag has the following syntactic structure…
“txp:article_custom”
大家把引号换成“<”和“/>”就对了。呵呵
Attributes -属性
Tag will accept the following attributes (case-sensitive):
这个标签接受下面的属性。
id=“integer”
The id# of any live article.
这个id属性可以用到任何激活的文章。
customfieldname=“value”
Restrict to articles with specified value for specified custom field name. Replace “customfieldname” with the name of the custom field.
customfieldname用户自定义的属性名称,这个标签可以限制自定义的模块。使用的时候把 “customfieldname“换成你自己定义的名称。
keywords=“comma-separated values”
Restrict to articles with specified keyword(s).
限制文章的关键词。
excerpted=“value”
Restrict by excerpt value. Available values: y (yes, return only those containing an excerpt) or n (no, return all). Default is n (no, return all).
摘要显示,限制摘要的属性值,可用的值有:y(yes,当包含摘要的时候返回)和n(no,返回所有)。默认的是n。
status=“value”
Restrict by status. Available values: draft, hidden, pending, live, sticky. Default value is live.
section=“section name”
Restrict to a specified section.
限制文章所属的版块。
category=“category name”
Restrict to a specified category.
限制文章所属的分类。
time=“time”
Restrict by time and date posted. Available values: past, future, or any (both past and future). Default is past.
month=“yyyy-mm”
Restrict to articles from the specified month.
限制文章的月份。
author=“author’s name”
Restrict to a specified author.
设置作者。
sort=“comma-separated values”
Sort retrieved articles. Available values: ID (article id#), AuthorID (author), LastMod (date last modified), LastModID (author of last modification), Posted (date posted), Title, Category1, Category2, comments_count, Status, Section, Keywords, Image (article image id#), url_title and custom_1 through custom_10, and each can be in ascending (first to last) or descending (last to first) order.
offset=“integer”
The number of articles to skip. Default is 0.
limit=“integer”
The number of articles to display. Default is 10.
allowoverride=“boolean”
Whether to allow override forms for the generated article list (does not effect individual articles). Available values: 1 (yes) or 0 (no). Default is 0 (no).
form=“form name”
Use specified form. Default is default. See Form.
本文评论功能已关闭。