类 CmsContentListDirective
java.lang.Object
com.publiccms.common.directive.BaseTemplateDirective
com.publiccms.common.base.AbstractTemplateDirective
com.publiccms.views.directive.cms.CmsContentListDirective
- 所有已实现的接口:
Directive,HttpDirective,freemarker.template.TemplateDirectiveModel,freemarker.template.TemplateModel
contentList 内容列表查询指令
contentList content list directive
contentList コンテンツリストクエリーディレクティブ
contentList コンテンツリストクエリーディレクティブ
参数列表
parameter list
パラメータリスト
categoryId:分类id,当parentId为空时有效categoryId:category id, effective when parentId is emptycategoryId:親IDが空のときに有効なカテゴリIDcontainChild:是否包含子分类,【true,false】containChild:whether to include subcategories, [true,false]containChild:サブカテゴリを含めるかどうか, [true,false]categoryIds:多个分类id,当categoryId为空时有效categoryIds:multiple category ids, effective when categoryId is emptycategoryIds:categoryIdが空のときに有効な複数のカテゴリIDmodelId:多个模型idmodelId:multiple model idsmodelId:複数のモデルIDparentId:父内容idparentId:parent content idparentId:親コンテンツIDonlyUrl:外链,【true,false】onlyUrl:external link, [true,false]onlyUrl:外部リンク, [true,false]hasImages:拥有图片列表,【true,false】hasImages:has image list, [true,false]hasImages:画像リストを持つ, [true,false]hasFiles:拥有附件列表,【true,false】hasFiles:has file list, [true,false]hasFiles:添付ファイルリストを持つ, [true,false]hasProducts:拥有产品列表,【true,false】hasProducts:has product list, [true,false]hasProducts:製品リストを持つ, [true,false]hasCover:拥有封面图,【true,false】hasCover:has cover image, [true,false]hasCover:カバー画像を持つ, [true,false]userId:发布用户iduserId:publish user iduserId:公開ユーザーIDstartPublishDate:起始发布日期,【2020-01-01 23:59:59】,【2020-01-01】startPublishDate:start publish date, [2020-01-01 23:59:59],[2020-01-01]startPublishDate:公開開始日, [2020-01-01 23:59:59],[2020-01-01]endPublishDate:终止发布日期,高级选项禁用时不能超过现在,【2020-01-01 23:59:59】,【2020-01-01】endPublishDate:end publish date, cannot exceed now when advanced option is disabled, [2020-01-01 23:59:59],[2020-01-01]endPublishDate:高度なオプションが無効のときに現在を超えることはできない公開終了日, [2020-01-01 23:59:59],[2020-01-01]advanced:开启高级选项, 默认为falseadvanced:enable advanced options, default isfalseadvanced:高度なオプションを有効にする, 既定値はfalsestatus:高级选项:内容状态,【0:操作,1:已发布,2:待审核,3:驳回】status:advanced option: content status, [0:operation,1:published,2:pending review,3:rejected]status:高度なオプション: コンテンツステータス, [0:操作,1:公開,2:レビュー待ち,3:拒否]disabled:高级选项:禁用状态,默认为falsedisabled:advanced option: disabled status, default isfalsedisabled:高度なオプション: 無効化ステータス, 既定値はfalseemptyParent:高级选项:父内容id是否为空,【true,false】,当parentId为空时有效emptyParent:advanced option: whether parent content id is empty, [true,false], effective when parentId is emptyemptyParent:高度なオプション: 親コンテンツIDが空かどうか, [true,false], parentIdが空のときに有効title:高级选项:标题title:advanced option: titletitle:高度なオプション: タイトルabsoluteURL:url处理为绝对路径 默认为trueabsoluteURL:process url as absolute path, default istrueabsoluteURL:URLを絶対パスに処理する, 既定値はtrueabsoluteId:id处理为引用内容的ID 默认为trueabsoluteId:process id as referenced content id, default istrueabsoluteId:IDを参照コンテンツのIDに処理する, 既定値はtruecontainsAttribute默认为false,http请求时为高级选项,为true时content.attribute为内容扩展数据map(字段编码,value)containsAttributedefault isfalse, advanced option for http requests, when true,content.attributeis content extended datamap(field code,value)containsAttribute既定値はfalse, HTTPリクエスト時の高度なオプション, trueの場合content.attributeはコンテンツ拡張データmap(フィールドコード,value)orderField排序字段,【score:评分,comments:评论数,clicks:点击数,collections收藏数,publishDate:发布日期,updateDate:更新日期,checkDate:审核日期】,默认置顶级别倒序、发布日期按orderType排序orderFieldsort field, [score:rating,comments:number of comments,clicks:number of clicks,collections:number of collections,publishDate:publish date,updateDate:update date,checkDate:review date], default is descending order of top level, publish date sorted by orderTypeorderFieldソートフィールド, [score:評価,comments:コメント数,clicks:クリック数,collections:コレクション数,publishDate:公開日,updateDate:更新日,checkDate:レビュー日], 既定値はトップレベルの降順、orderTypeでソートされた公開日orderType:排序类型,【asc:正序,desc:倒序】,默认为倒序orderType:sort type, [asc:ascending,desc:descending], default is descendingorderType:ソートタイプ, [asc:昇順,desc:降順], 既定値は降順firstResult:开始位置,从1开始firstResult:start position, starts from 1firstResult:開始位置, 1から始めるpageIndex:页码,firstResult不存在时有效pageIndex:page number, effective when firstResult does not existpageIndex:ページ番号, firstResultが存在しないときに有効pageSize:每页条数pageSize:number of items per pagepageSize:ページあたりのアイテム数maxResults:最大结果数maxResults:maximum number of resultsmaxResults:最大結果数
返回结果
return result
戻り値
page:PageHandlerpage.list:List类型 查询结果实体列表CmsContentpage.list:List type query result entity listCmsContentpage.list:リスト型 クエリ結果エンティティリストCmsContent
<@cms.contentList pageSize=10><#list page.list as a>${a.title}<#sep>,</#list></@cms.contentList>
<script>
$.getJSON('${site.dynamicPath}api/directive/cms/contentList?pageSize=10', function(data){
console.log(data.page.totalCount);
});
</script>
-
字段概要
字段修饰符和类型字段说明private CmsContentAttributeServiceprotected ContentConfigComponentprotected FileUploadComponentprivate CmsContentServiceprivate StatisticsComponent从类继承的字段 com.publiccms.common.base.AbstractTemplateDirective
ADVANCED, APP_TOKEN, AUTH_TOKEN, AUTH_USER_ID, siteComponent从类继承的字段 com.publiccms.common.directive.BaseTemplateDirective
log从接口继承的字段 freemarker.template.TemplateModel
NOTHING -
构造器概要
构造器 -
方法概要
从类继承的方法 com.publiccms.common.base.AbstractTemplateDirective
execute, expose, getAdvanced, getApp, getSite, getUser, getUserId, needAppToken, needUserToken从类继承的方法 com.publiccms.common.directive.BaseTemplateDirective
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
-
字段详细资料
-
contentConfigComponent
-
attributeService
-
fileUploadComponent
-
statisticsComponent
-
service
-
-
构造器详细资料
-
CmsContentListDirective
public CmsContentListDirective()
-
-
方法详细资料
-
execute
public void execute(RenderHandler handler) throws IOException, freemarker.template.TemplateException - 参数:
handler-- 抛出:
IOExceptionfreemarker.template.TemplateException
-
supportAdvanced
public boolean supportAdvanced()- 覆盖:
supportAdvanced在类中AbstractTemplateDirective- 返回:
- support advanced parameters
-