• Resolved Lemoncakecake

    (@lemoncakecake)


    *Skip this paragraph if you just want to read my question
    Basically, I am writing a shortcode where when you click on the icon in tinyMCE, it brings up a custom dialog box that asks for a URL. It sends that URL to another PHP page which dissects the page to figure out how it can display the content (be it a custom video player specific to that site, an img, etc) and then returns those variables.

    What I would like to do is at the caret position in tinyMCE, insert this result (ex, [media id=”Something” url=”www.example.com”]). I found tinyMCE.execCommand(mceInsertContent etc. but I can’t figure out how to execute it correctly…

Viewing 1 replies (of 1 total)
  • Thread Starter Lemoncakecake

    (@lemoncakecake)

    Nevermind. I figured it out. Quite the obvious solution; I just had to figure out what the textarea’s id was and put that in my code:

    tinyMCE.execInstanceCommand('content', "mceInsertContent", false, "Text To Insert Here");

Viewing 1 replies (of 1 total)

The topic ‘How would one insert content into tinyMCE?’ is closed to new replies.