How to pass query string parameters in ckeditor for the picture (ckfinder) button?

夙愿已清 提交于 2019-12-25 19:17:11

问题


I am using ckeditor 3 and ckfinder. When I press on the picture button in ckeditor I see the popup of ckfinder. I can select a picture and it will be inserted in the content of ckeditor. Now I would like to pass some query string parameters in the ckfinder popup. In the connector I would like to read this query string parameter.

For example:

connectorBuilder.SetAuthenticator(customAuthenticator)
                .LoadConfig()
                .SetRequestConfiguration(
                    (request, config) =>
                    {
                       var someQueryStringParameter = request.QueryParameters.SingleOrDefault(s => s.Key == "someQueryStringParameter").Value;
                    });

回答1:


Hi I don't know which CKFinder you're using but for CKFinder 3 (with CKEditor 4) you can use connectrInfo when using CKFinder.setupCKEditor() integration method (pass it in config object). Also check CKEditor integration docs.

In the connector I would like to read this query string parameter.

It is important to note that these parameters from connctorInfo will not be added to URL in popup but to requests directed to CKFinder. For configuration like:

var editor = CKEDITOR.replace( 'editor1', {     
    height:350
} );
CKFinder.setupCKEditor( editor, {
    connectorInfo : 'mytoken=7a9s0s1',
    pass : 'test,another',
    test : 'mytest',
    another : 'myanother'           
} );

the result will be as follows:



来源:https://stackoverflow.com/questions/49134903/how-to-pass-query-string-parameters-in-ckeditor-for-the-picture-ckfinder-butto

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!