【问题标题】:Magnolia CMS: reference YAML config from JCR configMagnolia CMS:从 JCR 配置中引用 YAML 配置
【发布时间】:2017-02-07 13:04:57
【问题描述】:

我通过 JCR 配置完成了我的 page configuration

我有 component configuration 使用 YAML 配置。

我想让这个组件可用于 JCR 中配置的模板。


组件配置位于:/project-website-module/src/main/resources/website-module/components/linkList/linkList.yaml

我尝试以不同的方式在模板的组件可用性中引用它:

  • website-module:components/linkList/linkList
  • website-module:components/linkList/linkList.yaml
  • /website-module/components/linkList/linkList
  • /website-module/components/linkList/linkList.yaml
  • src/main/resources/website-module/components/linkList/linkList
  • src/main/resources/website-module/components/linkList/linkList.yaml

但没有运气,我不断收到错误:

"Caused by: info.magnolia.config.registry.Registry$NoSuchDefinitionException: <pathToComponentConfiguration>"

【问题讨论】:

    标签: configuration yaml jcr magnolia


    【解决方案1】:

    组件配置位于: /project-website-module/src/main/resources/website-module/dialogs/linkList/linkList.yaml

    ...那是对话框配置,组件配置yaml在哪里? 组件配置的路径不是对话框配置是您在引用组件时需要使用的路径。并且该配置文件需要在物理上位于src/main/resources/website-module/templates/components/...,然后引用是website-module:components/...

    另外,如果你已经为模块指定了模块描述符,模块描述符中的名称最好匹配website-module

    【讨论】:

    • 是的,你是对的。我在我的问题中犯了一个错误。我现在已经更正了它并参考 component 配置的路径
    【解决方案2】:

    我不得不将YAML 组件配置移到下面(注意添加了templates 目录):

    /project-website-module/src/main/resources/website-module/templates
    

    在我的情况下,将linkList.yaml移到:

    /project-website-module/src/main/resources/website-module/templates/components/linkList/linkList.yaml
    

    然后在JCR 配置中,使用以下路径:

    website-module:components/linkList/linkList
    

    注意:同样,YAML 对话框配置必须在:

    /project-website-module/src/main/resources/website-module/dialogs
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-01
      相关资源
      最近更新 更多