Ckeditor链接与基本路径 [英] Ckeditor Link with basepath

查看:168
本文介绍了Ckeditor链接与基本路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CKeditor,但是我在暂存环境中对其进行了测试。然后,我将其投入生产。问题是当我链接时,我不想使用mysite.com,因为那样将只能在舞台或生产上使用,而不能同时在两者上使用。相反,我想使用我的basepath php变量,该变量将自动确定使用mysite.com/或staging.mysite.com

Im using CKeditor however i test it on a staging environment. Then i move it to production. The problem is when im linking i dont want to use mysite.com because then it will only work on staging or production but not on both. Instead i would like to use my basepath php variable which will auto determine to use mysite.com/ or staging.mysite.com

有没有办法用CKeditor URL链接选项。我尝试将其设置为:

Is there any way to do this with the CKeditor URL link option. I have tried setting it to:

/myfolder/mypage.php

使用其他协议,但是将URL设置为http /// myfolder / mypage.php

Using the other protocol, however it sets the URL as http///myfolder/mypage.php

这是否可能或是否有插件可以为我做到这一点?

Is this possible or is there an addon that can do this for me?

我的config.js文件按要求提供:

My config.js file as requested:

CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
};

我确实找到了如何更改Ckeditor的基本路径,但这只是ckeditor安装路径所在的位置,我需要设置一个不同的路径,仅是基本路径

I did find out how to change the basepath for Ckeditor but this is just where ckeditor install path is, i need to set a different path which is just the basepath

请澄清一下,因为图片说出了千个单词,而所有内容都是这样:

Just to clarify as a picture speaks a thousand words and all:

此操作可在Ckeditor工具栏中创建一个链接选项,可让您创建我要引用的URL链接

Its this create a link option in the Ckeditor toolbar that allows you to create a URL link that i am referring to

推荐答案

我知道这并不理想,因为它很容易破解,但是您可以转到 ckeditor / plugins / link / dialogs / link.js 在代码中找到它:

I know this isn't ideal as it's a hack, but you can go to ckeditor/plugins/link/dialogs/link.js find this in the code:

label:i.protocol,"default":"http://",items:[["http://‎","http://"],["https://‎","https://"],["ftp://‎","ftp://"],["news://‎","news://"],[b.other,""]]

然后只需添加另一个选项项目数组中的n,例如 [ Base URL, /]

Then just add another option in the items array like ["Base URL","/"].

我确实找到了可能也满足您需求的解决方案: http://ckeditor.com/forums/CKEditor-3.x/internal-pages-dropdown-link-dialog

I did find this solution that may also suit your needs: http://ckeditor.com/forums/CKEditor-3.x/internal-pages-dropdown-link-dialog

希望有帮助。

这篇关于Ckeditor链接与基本路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆