ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 方式一 ``` <!--热门文章/start--> <dl class="fly-panel fly-list-one"> <dt class="fly-panel-title">热门文章</dt> <php> $hot_articles=[]; </php> <portal:articles limit="10" order="post.post_hits DESC"> <dd> <a title="{$vo.post_title}" href="{:url('portal/article/index',array('id'=>$vo['id']))}"> {$vo.post_title} </a> <!--<span><i class="iconfont icon-pinglun1"></i> 16</span>--> </dd> </portal:articles> </dl> <!--热门文章/end--> ``` ## 方式二:widget - json html ``` <!--热门文章/start--> <widget name="hottest_articles"> <dl class="fly-panel fly-list-one"> <dt class="fly-panel-title">{$widget.title}</dt> <php> $hot_articles=[]; </php> <portal:articles limit="5" order="post.post_hits DESC" categoryIds="$widget.vars.hottest_articles_category_id"> <php>$top=$key<3?"top3":"";</php> <dd class="{$top}"> <i>{$key+1}</i> <a title="{$vo.post_title}" href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}"> {$vo.post_title} </a> </dd> </portal:articles> </dl> </widget> <!--热门文章/end--> ``` json ``` { "name": "文章页", "action": "portal/Article/index", "description": "文章页模板文件", "order": 10.0, "more": { "vars": { }, "widgets":{ "hottest_articles": { "title": "热门文章", "display": "1", "vars": { "hottest_articles_category_id": { "title": "文章分类ID", "value": "", "type": "text", "dataSource": { "api": "portal/category/index", "multi": true }, "placeholder": "请选择分类", "tip": "", "rule": { "require": true } } } } } } } ```