php - 带有基本路径的 Ckeditor 链接

标签 php ckeditor

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

有没有办法使用 CKeditor URL 链接选项来做到这一点。我尝试将其设置为:

/myfolder/mypage.php

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

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

我请求的 config.js 文件:

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

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

只是为了澄清,因为一张图片能说明一千个单词:

这是 Ckeditor 工具栏中的创建链接选项,允许您创建我所指的 URL 链接

enter image description here

最佳答案

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

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

然后只需在 items 数组中添加另一个选项,例如 ["Base URL","/"]

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

希望对您有所帮助。

关于php - 带有基本路径的 Ckeditor 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33318228/

相关文章:

PHP 与继承类的协方差 - 声明不兼容

php - MySQL 条件连接查询(WordPress 数据库)

javascript - Django + Vue.js 导入模块

php - sql查询过滤两个表中的数据

java - 什么样的数据库以及如何创建它来对文本进行分层分类?

javascript - CkEditor 4.3 的 Image2 插件 : how to remove URL and add border management to the properties dialog

selenium - 如何使用WebDriver获取CKeditor的内容

javascript - CKEDITOR 4.0 动态分离工具栏

javascript - CKEditor + Bootstrap modal + LayoutManager 插件,selection.getStartElement() 返回 null

php - 使用 wkhtmltopdf 设置横向