在 Magnolia cms Blossom 中配置 fckconfig.js

发布于 2024-12-20 01:36:35 字数 1067 浏览 4 评论 0原文

我正在尝试配置 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜中书 2024-12-27 01:36:35

一般来说,在 Magnolia 中,您根本不会乱动 fckconfig.js 文件。它被设置为根据为控件设置的选项动态生成。相反,您只需适当设置选项即可启用您想要的功能。根据用户列表上的这篇文章,你想做这样的事情:

@DialogFactory("my-dialog")
public void myDialog(DialogBuilder myDialog) {
  TabBuilder settings = myDialog.addTab("Main page settings");
  settings.addEdit("title", "Title", "The HTML page title");
  FckEditorDialog fedContent = settings.addFckEditor("content", "Content", "The Content"); 
  fedContent.setConfig(FckEditorDialog.PARAM_IMAGES, true);
}

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:

@DialogFactory("my-dialog")
public void myDialog(DialogBuilder myDialog) {
  TabBuilder settings = myDialog.addTab("Main page settings");
  settings.addEdit("title", "Title", "The HTML page title");
  FckEditorDialog fedContent = settings.addFckEditor("content", "Content", "The Content"); 
  fedContent.setConfig(FckEditorDialog.PARAM_IMAGES, true);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文