Skip to content

A CKEditor4 link plugin adding the ability to link to local (CMS) pages. Rely on jQuery for ajax calls.

License

Notifications You must be signed in to change notification settings

simogeo/ckeditor-adv_link

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ckeditor-adv_link

A CKEditor4 link plugin adding the ability to link to local (CMS) pages. Rely on jQuery for ajax calls (un-intrusive). This implementation supports internationalisation (see below).

It works with version 4.5.3.

Disclaimer

I developed that script for my needs and inspired by this blog post and this StackOverflow answer. I want people to be able to use it but I don't pretend to do any support regarding installation or use. It works well with CKEditor v 4.2.2. You want to make it work with other versions? Just do it and share it back.

Enhancement

I really think it would be great to replace the select input by a list of links contained in a HTML div or even better an input text with ajax call (like in WP). I do not have time now to do that. If you want to involve yourself, you're more than welcome.

How to install it ?

  1. Download and extract adv_link folder into CKEditor plugins folder

  2. Disable default link plugin and enable the new one. To do so, in your config.js file :

CKEDITOR.editorConfig = function( config )
{
	// Define changes to default configuration here.
	 
	 config.removePlugins = 'link';
	 config.extraPlugins = 'adv_link';

	// whatever

};
  1. In dialogs/links.js file, set the URL of the page which generates inputs to populate the plugin. It is located around line 377. A PHP script sample is given in sample folder and can be a good start.

  2. Test your installation by using the plugin.

  3. It should be working, adapt your script to get the rights inputs.

  4. If it does not work, use javascript debugging tool.

Internationalization ready

All languages are embedded in the source code. They are just copies of the default link plugin. But few of them are translated.

3 new vars are defined in language files (at the top) :

localPages:'Local pages',
selectPageLabel:'Select a page',
selectPageTitle:'Select the page you want to link to',

If you can't see them in the selected language file, you'll have to copy-paste from en.js file. Please, share your translation with others users.

About

A CKEditor4 link plugin adding the ability to link to local (CMS) pages. Rely on jQuery for ajax calls.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published