Hi guys,
I need to grab the temporary content of the editor and insert it in a custom PHP page in order to have a better preview functionnality.
So, how do I do?
Thanks a lot for the help
Cheers
Sun, 12/17/2006 - 03:12
#1
RE: How to grab the temporary content?
Otherwise you'd have to handle this in your own PHP code. Make a submit button "Preview" that doesnt save your content but instead pops up a new window showing the value that was submitted from the editor. Actually this might give a more realistic preview incase certain HTML-magic has been done when submitting the editor.
RE: How to grab the temporary content?
Thanks magnurz


In case I would like to use Javascript, where is the temporary content stored? In a cookie? In a global variable? Which one? This info would be very useful to me.
I reckon that retrieving this value from a different browser window might be very tricky.
It would be easier if the data was stored in a cookie though.
As for the popup idea, I don't know how to output the result of a form submission in a different window. If it is really possible, it would be best if fckeditor wasn't reloaded upon each preview. It's already long enough to load once
Thanks again
RE: How to grab the temporary content?
But the editor already provides a button with a preview in a separate window. Is this not enough for your needs?
Rgds,
Axel
RE: How to grab the temporary content?
Hi Caterham

The existing preview button doesn't show the content in its real context ( page layout, real url, highligthed hyperlinks for current page, etc. ).
Also, the template feature of fckeditor uses XML syntax which I ignore completely and I also lack time for learning.
It would be great if I could simply grab the temporary content and store it inside a cookie with an onclick event on a _blank href. The page on the new window would then just take the content from the cookie and display it within the real layout.
"I think you can get the content from editor Value property of the editor object. "
Would you have a practical example, a line of code?
I don't know how to manipulate objects in Javascript
RE: How to grab the temporary content?
use this plugin: https://sourceforge.net/tracker/index.p ... tid=737639
RE: How to grab the temporary content?
Thanks Alfonsoml

Unfortunately, this plugin has several drawbacks, the biggest one being that you need to POST the data which is a problem for my current project.
But, I saw in the js file that the content is called like this : FCK.GetXHTML();
Do you know how I could successfully call the function GetXHTML() from anywhere in a page were fckeditor is installed? ( onclick="alert(FCK.GetXHTML())" or onclick="alert(GetXHTML())" don't work )
If it is possible, I'll be able to try my first idea : store the content in a cookie, which seems easier to retrieve afterwards, thus providing more flexibility.
Thanks for the help
RE: How to grab the temporary content?
Trying to use a cookie to store html content is a bad idea because cookies are limited to around 2kb if I'm right.
Using a POST to the page that can process the data at the server is really the best option, you can customize it anyway you need and you won't find any limitation imposed by the browser.
Anyway, if you want to do it any other way, just read the docs: http://wiki.fckeditor.net/Developer%27s ... script_API
RE: How to grab the temporary content?
Many thanks Alfonso
I'll read the doc you kindly provided.
Cheers
RE: How to grab the temporary content?
Have you tried using a perl script? I use it to display the content of the editor in a new window.
Looks something like that:
#-------------------------------------------------------------------#
my $editorcontent = $cgi->param('FCKeditor1');
print $cgi->header(),
$cgi->start_html('CGI-Feedback');
print $reportcontent;
print $cgi->end_html();
#-------------------------------------------------------------------#
If you edit whole html files with FCK you won't need the "print $cgi...." statements.
I have never worked with perl before, but I realized that this would be the easiest way to
catch the editor content via Post.
RE: How to grab the temporary content?
I, too, am trying to access the value of an fck editor instance in another page. So far, I have a button open a new window, & would like to display the contents of the editor from the opening window so that they appear as they would on a live site. I've been trying to do this in javascript, so I can use the window.opener property. So far, I am able to see the fck instance in the opener window, but no luck thus far in accessing the content... Anyone know how to do this?
- O8