Magnolia CMS页面模板编辑时编辑器空白问题:如何使页面对话框正常显示?
Let’s walk through the most common fixes for the blank page editor issue you’re facing—since you’ve already confirmed the [@cms.page /] tag is present in your template, the problem likely lies in configuration paths or placeholder values:
1. Replace the module-name placeholder with your actual module name
This is the most probable root cause. The mgnl create-page command uses module-name as a generic placeholder, but you need to swap it with your real module's name everywhere:
- Update your
hello.yamltemplate definition:title: hello templateScript: /your-real-module-name/templates/pages/hello.ftl renderType: freemarker dialog: your-real-module-name:pages/hello visible: true - In
hello.ftl, replace all instances ofmodule-namewith your module name (especially if you plan to use the commented-out resource/theme lines later):<!-- Example if you uncomment the resource links --> <link rel="stylesheet" type="text/css" href="${ctx.contextPath}/.resources/your-real-module-name/webresources/css/bootstrap.css" media="all" />
2. Verify the template is registered in your module's config
Check if your hello template is listed in your module's templates/pages.yaml file. If it’s missing, add this entry to ensure Magnolia recognizes the template:
hello: title: hello templateScript: /your-real-module-name/templates/pages/hello.ftl renderType: freemarker dialog: your-real-module-name:pages/hello visible: true
3. Double-check dialog path validity
Even though the page creation form works, confirm the dialog reference is correctly mapped:
- Ensure
dialogs/pages/hello.yamlexists in your module directory with valid field definitions. - The dialog reference format
module-name:pages/hellopoints to/module-name/dialogs/pages/hello.yaml—make sure your module name here matches exactly.
4. Check Magnolia logs for specific errors
If the above steps don’t fix the issue, look into the magnolia.log file (usually in your Magnolia instance’s logs folder) for clues. Common errors to watch for:
TemplateNotFoundException: Magnolia can’t locate yourhello.ftlfile (path mismatch)DialogNotFoundException: The dialog path in your template definition is invalid- Freemarker syntax errors: Typos or invalid logic in your
.ftlfile
5. Add editable areas (optional)
While this won’t resolve a blank editor, if you want users to edit page content directly, add a CMS area to your hello.ftl:
<div class="container"> <h1>hello works!</h1> [@cms.area name="mainContent" /] </div>
Then update your hello.yaml template definition to include the area configuration.
内容的提问来源于stack exchange,提问作者George




