George
George

Reputation: 1

Magnolia CMS Page dialog empty

I've created a page-template with mgnl create-page hello. The command run successfully, and created the necessary files:

  1. templates/pages/hello.yaml
  2. dialogs/pages/hello.yaml
  3. templates/pages/hello.ftl

When I create a page, a form appears with seemingly the correct fields.

But when I try to edit the page, the page editor box is empty.

Even though the .ftl file contains [@cms.page /] in the head element.

File contents of hello.ftl:

<!DOCTYPE html>
<html xml:lang="${cmsfn.language()}" lang="${cmsfn.language()}">
  <head>
    [@cms.page /]
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>${content.windowTitle!content.title!}</title>
    <meta name="description" content="${content.description!""}" />
    <meta name="keywords" content="${content.keywords!""}" />

    [#-- To load resources you can link them manually (e.g. line below) --]
      [#-- <link rel="stylesheet" type="text/css" href="${ctx.contextPath}/.resources/module-name/webresources/css/bootstrap.css" media="all" /> --]
      [#-- <script src="${ctx.contextPath}/.resources/module-name/webresources/js/jquery.js"></script> --]
    [#-- or via theme --]
      [#-- [#assign site = sitefn.site()!] --]
      [#-- [#assign theme = sitefn.theme(site)!] --]
      [#-- [#list theme.cssFiles as cssFile] --]
      [#--   [#if cssFile.conditionalComment?has_content]<!--[if ${cssFile.conditionalComment}]>[/#if] --]
      [#--     <link rel="stylesheet" type="text/css" href="${cssFile.link}" media="${cssFile.media}" /> --]
      [#--   [#if cssFile.conditionalComment?has_content]<![endif]-->[/#if] --]
      [#-- [/#list] --]
      [#-- [#list theme.jsFiles as jsFile] --]
      [#--   <script src="${jsFile.link}"></script> --]
      [#-- [/#list] --]
    [#-- uncomment next line to use resfn templating functions to load all css which matches a globbing pattern --]
      [#-- ${resfn.css(["/module-name/.*css"])!} --]
  </head>
  <body class="hello ${cmsfn.language()}">

    <div class="container">
      <h1>hello works!</h1>
    </div>

    [#-- use resfn to load all js which matches the globbing pattern or link resources manually or via theme --]
    [#-- ${resfn.js(["/module-name/.*js"])!} --]
  </body>
</html>

File contents of hello.yaml:

title: hello
templateScript: /module-name/templates/pages/hello.ftl
renderType: freemarker
dialog: module-name:pages/hello
visible: true

How can I see make the Page dialog "visible"?

Upvotes: 0

Views: 304

Answers (1)

Bradley Andersen
Bradley Andersen

Reputation: 311

Try this:

mgnl create-component test --available hello@main

Then edit

templates/pages/hello.ftl

To move the last line

[@cms.area name="main"/]

to just above the </body> tag.

Upvotes: 0

Related Questions