文章列表标签:portal:articles使用详解

文章列表标签:portal:articles使用详解

标签: <portal:articles></portal:articles>数组

做用: 文章列表标签,可调用文章列表post

用法示例:code

<portal:articles item="vo" where="$where" order="post.create_time DESC" page="$page"
                         relation="categories"
                         categoryIds="$category.id"
                         returnVarName="articles_data">
 .. HTML ..
 </portal:articles>

标签属性:排序

标签属性名 含义
where 查询条件变量, 支持数组和字符串,如$where
limit 最多查出文章数,若是分页开启,此设置无效
order 文章排序方式
page 分页参数,若是设置分页参数会自动分页
relation 关联查询,支持categories和user,多个以英文逗号分隔
pageVarName 分页后生成的分页变量名,只有设置分页参数时才有效
categoryIds 分类 id,支持数组和字符串(英文逗号分开)
相关文章
相关标签/搜索