Page History
...
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
|
While doing development it is sometimes useful to edit scripts in the repository. This method only works with Freemarker scripts. If you bootstrap scripts into the templates
workspace they become visible and editable in STK > Templates. All STK scripts follow this model. As you can see from the loading order above a script in the templates
workspace will override a script loaded from the classpath. Once added or modified, it is necessary to select the Enable template checkbox to force Magnolia CMS to load the template from the repository.
Warning |
---|
Editing template scripts in the repository is ideal for evaluation, prototyping or smaller projects. However, it is not maintainable in the long run. Don't do it in a production environment. We strongly recommend that you store the scripts in a version control system and package them into a project module. |
See Templating samples > Editing template scripts for more information.
...
|
开发时,在内容库里编辑脚本有时候很有用。这种方法只对FreeMarker脚本有效。如果您将脚本导入templates
工作区,它们就会在STK > Templates里可见可用。所有的STK脚本都遵循这个模式。您可以从以上的加载顺序看出,在templates
工作区里的脚本会覆写从类路径里加载的脚本。一旦被添加或修改,则需要选中Enable template复选框来强迫Magnolia CMS从内容库中加载模板。
Warning |
---|
在内容库里编辑模板脚本对评估,制造原型,或较小的项目比较理想。然后,长期来说这不利于维护。不要在生产环境中这样做。我们强烈建议您在一个版本控制系统中存储脚本,并将它们打包进一个项目模块。 |
参考模板样例 > 编辑模板脚本里更多信息。
STK脚本
STK template scripts are in the classpath of the webapp. Copies are editable in-place in STK > Templates. STK scripts are written in FreeMarker.
...