在玉兰花管理中心的页面应用上创建页面时出错

时间:2018-06-08 13:09:23

标签: magnolia

这是我的模板定义:

templateScript: /one-pager-module/templates/pages/main.ftl
renderType: freemarker
visible: true
title: One pager template
dialog: one-pager-module:pages/main
areas:
  content-sections:
    renderType: freemarker
availableComponents:
  content-items-list:
    id: one-pager-module:components/content-items-list
  textImage:
    id: one-pager-module:components/textImage

这是我的模板脚本

[#assign title = content.title!"Eric's Classic Cars"]
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="${content.keywords!""}"/>
    <meta name="description" content="${content.description!""}"/>
    <meta name="author" content="">

    <title>${title}</title>

    [#--bootstrap css--]
    <link rel="stylesheet" href="${ctx.contextPath}/.resources/one-pager-module/webresources/bootstrap-3.3.5/bootstrap.min.css ">
    <link rel="stylesheet" href="${ctx.contextPath}/.resources/one-pager-module/webresources/bootstrap-3.3.5/bootstrap-theme.min.css ">
    [#--Custom CSS--]
    <link rel="stylesheet" href="${ctx.contextPath}/.resources/one-pager-module/webresources/css/one-pager.css?z=123">
    <link href="http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
    [#--HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries--]
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    [@cms.page /]
</head>
<body>
  <h1>${title}</h1>
  <p>${content.subTitle!"No subtitle defined"}</p>

    [#--jquery and bootstrap js--]
    <script src="${ctx.contextPath}/.resources/one-pager-module/webresources/bootstrap-3.3.5/jquery.js"></script>
    <script src="${ctx.contextPath}/.resources/one-pager-module/webresources/bootstrap-3.3.5/bootstrap.min.js"></script>
    <script src="${ctx.contextPath}/.resources/one-pager-module/webresources/bootstrap-3.3.5/jquery.easing.min.js"></script>
    [#--custom js--]
    <script src="${ctx.contextPath}/.resources/one-pager-module/webresources/js/one-pager.js"></script>
</body>
</html>

这是我的对话框定义

form:
  tabs:
    - name: tabText
      label: Title texts
      fields:
        - name: title
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          label: Title
        - name: subTitle
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          label: Subtitle
        - name: copyrightNote
          class: info.magnolia.ui.form.field.definition.RichTextFieldDefinition
          label: Copyright note
          description: Photographers who own the images used on this site

    - name: tabBgImage
      label: Background
      fields:
        - name: introBgImage
          class: info.magnolia.ui.form.field.definition.LinkFieldDefinition
          targetWorkspace: dam
          appName: assets
          label: Select image
          description: Background image of the intro section
          identifierToPathConverter:
            class: info.magnolia.dam.app.assets.field.translator.AssetCompositeIdKeyTranslator
          contentPreviewDefinition:
            contentPreviewClass: info.magnolia.dam.app.ui.field.DamFilePreviewComponent
    - name: tabMeta
      label: SEO
      fields:
        - name: keywords
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          i18n: true
          label: Keywords
          description: Keywords and description for search engine optimization
          rows: 3
        - name: description
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          i18n: true
          label: Description
          rows: 5
actions: !include /one-pager-module/dialogs/common/default-dialog-actions.yaml

当我在管理中心创建页面时,我收到此错误。

info.magnolia.ui.api.action.ActionExecutionException: Action execution failed for action: commit
....
Caused by: info.magnolia.config.registry.Registry$InvalidDefinitionException: one-pager-module:pages/main

我做错了什么?它以前工作过吗? 我正在按照教程:https://documentation.magnolia-cms.com/display/DOCS56/Creating+a+page+template

1 个答案:

答案 0 :(得分:0)

是的,它可能是,但我们需要更多信息才能确定。

为了使您的模板定义有效,它“拉入”的所有内容也必须有效,包括您的content-items-list组件定义。我已经使用上面的定义成功地向演示实例添加了一个页面,当然没有你的content-items-list组件,因为它不包括在这里。

也可能是您的操作包含错误或位置错误。

您是否检查过“定义”应用中的“问题”标签?