@Component public class CmsCategoryModelDirective extends AbstractTemplateDirective
参数列表
categoryId
:分类id,结果返回object
CmsCategoryModel
modelId
:内容模型id,当id为空时生效,结果返回object
modelIds
多个内容模型id,当categoryId存在,且modelId为空时生效,结果返回map
(内容模型id,object
)
categoryIds
多个分类id,当categoryId不存在,且modelId存在时生效,结果返回map
(分类id,object
)
<@cms.categoryModel categoryId=1 modelId='article'>${object.templatePath}</@cms.categoryModel>
<@cms.categoryModel categoryIds=1,2,3 modelId='article'><#list map as k,v>${k}:${v.templatePath}<#sep>,</#list></@cms.categoryModel>
<script> $.getJSON('${site.dynamicPath}api/directive/cms/categoryModel?categoryId=1&modelId=article', function(data){ console.log(data.templatePath); }); </script>
限定符和类型 | 字段和说明 |
---|---|
private CmsCategoryModelService |
service |
ADVANCED, AUTH_TOKEN, AUTH_USER_ID, siteComponent
log
构造器和说明 |
---|
CmsCategoryModelDirective() |
限定符和类型 | 方法和说明 |
---|---|
void |
execute(RenderHandler handler) |
execute, expose, getAdvanced, getApp, getSite, getUserId, needAppToken, needUserToken, supportAdvanced
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
private CmsCategoryModelService service
public void execute(RenderHandler handler) throws java.io.IOException, freemarker.template.TemplateException
java.io.IOException
freemarker.template.TemplateException