## sp_list (文章列表)
>[info] 语法:sp_list($where, $order, $pagesize, $pageurl, $options)
> 参数:$where (必填)
> 参数:$order (选填)
> 参数:$pagesize (选填)
> 参数:$pageurl (选填)
> 参数:$options (选填)
案例 1:最简单的使用方法
```
<?php
// 获取 columnid = 21 的全部文章
$list = sp_list("wsarticle_columnid = 21");
?>
```
案例 2:分页数据
```
<?php
$where = "wsarticle_columnid = 21";
$order = "wsarticle_create_time desc";
$pagesize = 10;
$pageurl = "/news-p[page]";
$options = ['cate'=>true, 'param'=>true];
$list = sp_list($where, $order, $pagesize, $pageurl, $options);
?>
```
案例 3:分类分页数据
```
<?php
$where = "wsarticle_columnid = 21 and find_in_set(5, wsarticle_cateid)";
$order = "wsarticle_create_time desc";
$pagesize = 10;
$pageurl = "/news/industry-5-p[page]";
$options = ['cate'=>true, 'param'=>true];
$list = sp_list($where, $order, $pagesize, $pageurl, $options);
?>
```
案例 4:文章搜索
```
<?php
$keywords = "搜索关键词";
$where = "wsarticle_columnid = 21 and wsarticle_title like '%".$keywords."%'";
$order = "wsarticle_create_time desc";
$pagesize = 10;
$pageurl = "/news-p[page].html?keywords=".$keywords;
$options = ['cate'=>true, 'param'=>true];
$list = sp_list($where, $order, $pagesize, $pageurl, $options);
?>
```
**实际案例**
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{$site_home} - {$site_title}</title>
<meta name="keywords" content="{$site_keywords}">
<meta name="description" content="{$site_description}">
</head>
<body>
<h1>分类列表展示</h1>
{assign name="list" value=":sp_list('wsarticle_columnid = 21')"}
{volist name="list" id="vo"}
<div><a href="{:url('/news/'.$vo['wsarticle_id'])}">{$vo['wsarticle_title']}</a></div>
{/volist}
</body>
</html>
```
**支持字段**
>[success] 标题:wsarticle\_title
> 分类 ID:wsarticle\_cateid
> ~~静态页面:wsarticle\_page~~
> 简介:wsarticle\_desc
> 关键词:wsarticle\_keywords
> 描述:wsarticle\_description
> ~~内容:wsarticle\_details~~
> 图片:wsarticle\_image (使用 getimg 函数调用)
> 文件:wsarticle\_file
> 浏览量:wsarticle\_views
> 作者:wsarticle\_author
> 来源:wsarticle\_source
> 发布时间:wsarticle\_create\_time
> 需要更多字段请查看数据表 site_wsarticle