类 CmsContentDirective
java.lang.Object
com.publiccms.common.directive.BaseTemplateDirective
com.publiccms.common.base.AbstractTemplateDirective
com.publiccms.views.directive.cms.CmsContentDirective
- 所有已实现的接口:
Directive,HttpDirective,freemarker.template.TemplateDirectiveModel,freemarker.template.TemplateModel
content 内容查询指令
content query directive
コンテンツクエリーディレクティブ
コンテンツクエリーディレクティブ
参数列表
parameter list
パラメータリスト
id内容id,结果返回objectCmsContentidcontent id, result returnsobjectCmsContentidコンテンツID、結果はobjectCmsContentを返します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时object.attribute为内容扩展数据map(字段编码,value)containsAttributedefault isfalse, advanced option for http requests, when true,object.attributeis content extended datamap(field code,value)containsAttribute既定値はfalse, HTTPリクエスト時の高度なオプション、trueの場合object.attributeはコンテンツ拡張データmap(フィールドコード,value)ids: 多个内容id,逗号或空格间隔,当id为空时生效,结果返回map(id,object)ids: multiple content ids, separated by commas or spaces, effective when id is empty, result returnsmap(id,object)ids: 複数のコンテンツID、カンマまたはスペースで区切る、IDが空のときに有効、結果はmap(ID,object)を返します
使用示例
usage example
使用例
<@cms.content id=1>${object.title}</@cms.content>
<@cms.content ids=1,2,3><#list map as k,v>${k}:${v.title}<#sep>,</#list></@cms.content>
<script>
$.getJSON('${site.dynamicPath}api/directive/cms/content?id=1', function(data){
console.log(data.title);
});
</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
-
-
构造器详细资料
-
CmsContentDirective
public CmsContentDirective()
-
-
方法详细资料
-
execute
public void execute(RenderHandler handler) throws IOException, freemarker.template.TemplateException - 参数:
handler-- 抛出:
IOExceptionfreemarker.template.TemplateException
-
supportAdvanced
public boolean supportAdvanced()- 覆盖:
supportAdvanced在类中AbstractTemplateDirective- 返回:
- support advanced parameters
-