类 CmsCategoryModelDirective

所有已实现的接口:
Directive, HttpDirective, freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel

@Component public class CmsCategoryModelDirective extends AbstractTemplateDirective
categoryModel 分类内容模型映射查询指令

参数列表

parameter list

パラメータリスト

  • categoryId:分类id,结果返回object CmsCategoryModel
  • modelId:内容模型id,当id为空时生效,结果返回object
  • modelIds 多个内容模型id,当categoryId存在,且modelId为空时生效,结果返回map(内容模型id,object)
  • categoryIds 多个分类id,当categoryId不存在,且modelId存在时生效,结果返回map(分类id,object)

使用示例

usage example

使用例

<@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>
 
  • 字段详细资料

  • 构造器详细资料

    • CmsCategoryModelDirective

      public CmsCategoryModelDirective()
  • 方法详细资料

    • execute

      public void execute(RenderHandler handler) throws IOException, freemarker.template.TemplateException
      参数:
      handler -
      抛出:
      IOException
      freemarker.template.TemplateException