在 Magnolia cms Blossom 中配置 fckconfig.js
我正在尝试配置 fck 编辑器以便能够使用它添加图像。
我知道当前格式在配置文件中设置如下:
FCKConfig.ToolbarSets["基本"] = [ ['粗体','斜体','-','OrderedList','UnorderedList','-','链接','取消链接','-','关于']
我不知道的是如何改变它。我怎样才能制作一个新的工具栏集并设置它? 我不能做的另一件事是访问配置文件。我还没找到它在哪里。我只能通过 .resources/fckeditor/fckconfig.js
这样的 url 访问它。
我在开花的模型类中尝试了以下代码:
FckEditorDialog fck = tab.addFckEditor("body", "Body", "添加正文 到视图"); fck.setConfig("enterMode", "br"); fck.setConfig("customConfigurationsPath", "/myconfig.js");
更改 enterMode
有效,但 customConfigurationsPath 无效。在 myconfig.js 中,我放置了以下代码:
FCKConfig.ToolbarSets["Basic"] = [
['Cut','Copy','Paste','PasteText','PasteWord'],
['Undo','Redo','-','Bold','Italic','Underline','StrikeThrough'],
'/',
['OrderedList','UnorderedList','-','Outdent','Indent'],
['Link','Unlink','Anchor'],
'/',
['Style'],
['Table','Image','Flash','Rule','SpecialChar'],
['About']
] ;
我认为我的配置文件的路径可能不好。我真的不知道该把它放在哪里..
非常感谢您的帮助:)
I'm trying to configure the fck editor in order to be able to add images with it.
I know that the current format is set in the config file like this:
FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
What I don't know is how to change it. How could I make a new toolbarsets and set it?
Another thing that I can't do is access the config file. I haven't found anywhere where it is. I can only access it throught the url like .resources/fckeditor/fckconfig.js
.
I've tried in the model class in blossom the following code:
FckEditorDialog fck = tab.addFckEditor("body", "Body", "Adds the body
to the view"); fck.setConfig("enterMode", "br");
fck.setConfig("customConfigurationsPath", "/myconfig.js");
Changing enterMode
works, but customConfigurationsPath doesn't. In myconfig.js I put the following code:
FCKConfig.ToolbarSets["Basic"] = [
['Cut','Copy','Paste','PasteText','PasteWord'],
['Undo','Redo','-','Bold','Italic','Underline','StrikeThrough'],
'/',
['OrderedList','UnorderedList','-','Outdent','Indent'],
['Link','Unlink','Anchor'],
'/',
['Style'],
['Table','Image','Flash','Rule','SpecialChar'],
['About']
] ;
I think that maybe the path to my configuration file isn't good. I don't really know where to put it..
Thank you very much for your help :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般来说,在 Magnolia 中,您根本不会乱动 fckconfig.js 文件。它被设置为根据为控件设置的选项动态生成。相反,您只需适当设置选项即可启用您想要的功能。根据用户列表上的这篇文章,你想做这样的事情:
Generally in Magnolia, you don't mess about with the fckconfig.js file at all. It's set up to be generated dynamically according to the options that are set for the control. Instead, you'd just set the options appropriately to enable the functionality you want. According to this post on the user list, you'd want to do something like this: