views:

171

answers:

1

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.

+3  A: 

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).

Steerpike
Did you create your plugin from scratch or did you find another one to base it on?
Jon Winstanley
we grabbed one of the existing plugins that was similar, like image insert or link insert and went from that as a template.
Steerpike
Great, thanks a lot!
Jon Winstanley