Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extending TinyMCE to show a list of possible Internal pages which the user may wish to link to

Is it possible to extend the TinyMCE rich text editor to allow the insertion of Internal Links to my web sites pages.

I already have a function which can return the list of page names and URLs however I cannot figure out how to add a new button to the Advanced Link plugin.

I have worked with the Image Manager and Document manager plugins before and so am aware that they are able to add their own 'browse' button within the advanced link dialogs.

Ideally when the user is in the link dialog I would like to present them with a list of possible pages to link to.

like image 576
Jon Winstanley Avatar asked Sep 23 '09 09:09

Jon Winstanley


1 Answers

We recently just added this to our CMS system, so yes, it's certainly doable. We found it easiest to just add a whole new button to tinyMCE that created its own popup that handled all the Internal Links stuff such as presenting a list of pages that could be linked to, creating the href itself and embedding it back into the page.

Our CMS system already had all the functionality to list pages in a tree format so if you have something similar you can just popup your own created page from the tinyMCE button.

(Also remember to give some thought to how you'll handle internal links to deleted or archived pages).

like image 171
Steerpike Avatar answered Oct 06 '22 00:10

Steerpike