TinyMCE Editor with Hype save data


(Jeroen) #1

Hello, In the past I already asked how to implement TinyMCE editor with Hype. Now I would like to know how to save the data in the .js file?

I have a little bit of text. The user can change the text online with the TinyMCE editor. When the user is finished changing the text he can save it by clicking on the save button. But how can I save it to the javascript file (where all the content is placed) that is made by Hype.

Here is the example file:
tinymce-editor.zip (24.0 KB)

I’ve done a lot of research and I found different approaches but I’m not sure how to implement it. Do I need a php script who can send the data to the javascript file. Or can I do it with javascript.
I found the following example: http://archive.tinymce.com/tryit/3_x/ajax_load_save.php

Hope someone can help me!


(Jonathan Deutsch) #2

I’m a little unclear on what you mean by “to save the data in the .js file.” If you’re looking to save non-locally, then you will need something on the server (like a PHP script) which can take the data from the local editor and write it on the server. Sending it back to the user also implies you’d need some sort of authentication system to know which user is which. Feel free to elaborate on your goals for the project for more specific advice!


(Jeroen) #3

What I meant was, is it possible to overwrite the data in the .js file. And the .js file is the generated file that is created by Hype. In the example file it will be ‘tinymceeditor_hype_generated_script.js’.

But I guess the easiest way is to create a php file that connects with a database where the content will be placed. So if the user changes the data, the PHP script will save the data in the database and show the new changes.


(Jonathan Deutsch) #4

Yes, that approach would be my recommendation.