Last active
August 29, 2015 14:17
-
-
Save andik/87e7b571e517e4458f8f to your computer and use it in GitHub Desktop.
TinyMCE Link List
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example of an array with links | |
tinymce.init({ | |
plugins: "link", | |
link_list: [ | |
{title: 'My page 1', value: 'http://www.tinymce.com'}, | |
{title: 'My page 2', value: 'http://www.moxiecode.com'} | |
] | |
}); | |
// Example of an array with links and sub-menu | |
// Since TinyMCE 4.0.27 it is now possible to have sub-menus within the link list. A TinyMCE Fiddle example of nested sub-menus is available. | |
tinymce.init({ | |
plugins: "link", | |
link_list: [ | |
{title: 'TinyMCE', value: 'http://www.tinymce.com'}, | |
{title: 'Moxiecode', value: 'http://www.moxiecode.com'}, | |
{title: 'TinyMCE resources', menu: [ | |
{title: 'TinyMCE documentation', value: 'http://www.tinymce.com/wiki.php'}, | |
{title: 'TinyMCE forum', value: 'http://www.tinymce.com/forum/index.php'} | |
]} | |
] | |
}); | |
// Example of a JSON URL with links | |
// You can also configure an URL with JSON data the format of that list is the same as above: | |
tinymce.init({ | |
plugins: "link", | |
link_list: "/mylist.php" | |
}); | |
// Example of a custom async function | |
tinymce.init({ | |
plugins: "link", | |
link_list: function(success) { | |
success([ | |
{title: 'My page 1', value: 'http://www.tinymce.com'}, | |
{title: 'My page 2', value: 'http://www.moxiecode.com'} | |
]); | |
} | |
}); | |
// Example of usage of the external_link_list_url option: | |
tinyMCE.init({ | |
... | |
external_link_list_url : "myexternallist.js" | |
}); | |
// Note: If utilizing the document_base_url option, the path to your file is relative from that base. If not set, your path is relative from the file containing the editor call. | |
// Example of a external link list file: (myexternallist.js) | |
var tinyMCELinkList = new Array( | |
// Name, URL | |
["Moxiecode", "http://www.moxiecode.com"], | |
["Freshmeat", "http://www.freshmeat.com"], | |
["Sourceforge", "http://www.sourceforge.com"] | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment