I am relatively new to this, but I just downloaded FCKeditor for use on coldfusion pages. I cannot seem to properly set it up and was wondering if someone knew of a site with step by step instructions side from the support site on the wiki page OR if someone could spell it out for me, that would be awesome too. Thanks.
Sat, 01/14/2006 - 09:49
#1
RE: Dreamweaver CFM help
RE: Dreamweaver CFM help
Did you check http://fckeditor.wikiwikiweb.de/Develop ... ColdFusion ?
RE: Dreamweaver CFM help
<cfscript>
fckEditor = createObject("component", "/PathToFCKMainDirectory/fckeditor");
fckEditor.instanceName = "myEditor";
fckEditor.value = "Text to display in the editor";
fckEditor.basePath = "/PathToFCKMainDirectory/";
fckEditor.width = '100%';
fckEditor.height = 300;
fckEditor.create(); // create the editor.
</cfscript>
PathToFCKMainDirectory: Absolute path, starting from your webroot, pointing to the directory where you unzipped FCKeditor.
An example: Lets say that you unzipped FCKeditor to:
C:\Inetpub\wwwroot\MyApplication\admin\MyMainFCKdirectory\ (wwwroot being the webroot)
In that case you have to replace /PathToFCKMainDirectory/ with /MyApplication/admin/MyMainFCKdirectory/
So you would have to use the following code to have FCKeditor displayed on your page:
<cfscript>
fckEditor = createObject("component", "/MyApplication/admin/MyMainFCKdirectory/fckeditor");
fckEditor.instanceName = "myEditor";
fckEditor.value = "Text to display in the editor";
fckEditor.basePath = "/MyApplication/admin/MyMainFCKdirectory/";
fckEditor.width = '100%';
fckEditor.height = 300;
fckEditor.create(); // create the editor.
</cfscript>
In order to get the filebrowser to work, you have to follow the steps explained on the Wiki.
Please let me know if this works out for you, so I can post this small tutorial on the Wiki, because other people might find this interesting too.
RE: Dreamweaver CFM help
<cfscript>
fckEditor = createObject("component", "/path to the directory/fckeditor/")
fckEditor.instanceName = "myEditor"
fckEditor.value = "Text to display in the editor"
fckEditor.basePath = "/path to the directory/fckeditor/"
fckEditor.width = '100%'
fckEditor.height = 300
fckEditor.create(); // create the editor.
</cfscript>
From the wiki page I see only installation of the samples and changing default userfiles directory (which I didn't do, b/c I did not change the directory.)
RE: Dreamweaver CFM help
Did my instructions help you at all?
Are you having problems getting the samples to work?
Are you using the last version of FCKeditor (2.2)?
Can you explain to me the folder structure you have FCKeditor installed in?
Are you on a Unix or Windows system?
RE: Dreamweaver CFM help
<cfscript>
fckEditor = createObject("component", "/MyApplication/admin/MyMainFCKdirectory/fckeditor");
fckEditor.instanceName = "myEditor"
fckEditor.value = "Text to display in the editor"
fckEditor.basePath = "/MyApplication/admin/MyMainFCKdirectory/"
fckEditor.width = '100%';
fckEditor.height = 300;
fckEditor.create(); // create the editor.
</cfscript>
RE: Dreamweaver CFM help
RE: Dreamweaver CFM help
If you are tyring to get Dreamweaver to show you a nice preview of what the editor panel will look like in your page layout you need to realize that this will not happen.
If you are like me and not a great programmer, you need to start in stages. Don't try to plop the editor code into some page deep in your site and expect it to work.
Didgiman did a great job of setting up the CF sample page for CFMX. If you put the entire FCKeditor folder into your root, the file "sample02_mx.cfm" in the "_samples/CFM" folder will work just as it is. I would make sure that works first.
Also, I noticed there are someone cfoutput tags that cross over tags that parts of other tags. For instance a cfoutput tag starts right before the open body tag, then closes after the first form tag opens. Dreaweaver hates this and thinks there are mismatched tags in the document - I just ignore the warnings in this case.
Didgiman: I have tried several times to get FCKeditor to work for me, but this last update unlocked it for me. I use Dreamweaver and ColdFusion because I am not a developer, but I need to do some fairly simple date sensitive input and output processes. Thanks.
RE: Dreamweaver CFM help
I'm sure you can try that one yourself, no?
You just need to make sure that your value for fckEditor.basePath points to the root directory of FCKeditor (the one that holds fckeditor.cfc and fckconfig.js amongst other files).
I already posted the code you need twice in this thread. I'm sure you can figure it out.
Let me know if you have any problems, but also let me know if you got it working with the hints I gave you. I can then craft a small tutorial out of this and post it on the wiki.
RE: Dreamweaver CFM help
You also might want to have a look at this thread:
https://sourceforge.net/forum/forum.php ... _id=257180
I'm sure that one doesn't display correctly, and the link is broken, but with a little imagination you can take out the ampersands and all the other stuff that screwed up the link and find the page.
Is short, there is a bug in the default fckconfig.js file that will prevent you from using the quick upload. I uploaded a patch that you can find in the euhm... Pathes section.
https://sourceforge.net/tracker/index.p ... tid=543653
Another broken link, I'm sure...
I'm seriously starting to hate the forum on sourceforge, since it's just impossible to post a decent line of code on it or a url for that matter. I hope we can move to the new forum quickly, FredCK!
RE: Dreamweaver CFM help
Is it possible for me to copy and paste the code from the sample and add it to the page to replace the text area?
Again, thanks for all the help.
RE: Dreamweaver CFM help
1) Make a copy of the working CFMX FCKeditor sample page in the directory you have the page you want to add the editor (I'll call that your "real" page).
2) Test the sample page in the new location. Just moving the page will likely cause addressing (path) problems. Look at the errors in the CFMX error box to figure out how you need to fix the problem.
In my case I needed to rework the way the basepath variable was calculated.
3) Once you have the sample working in the new location, you can then move the needed code from the sample page to your real page.
4) What I do here is to build the form I need with a textarea where I want FCKeditor. Then I move into the code view and make comments above and below the textarea field I want to replace with the FCKeditor code. Then I remove the textarea code. (Leaving the comments to mark where I come back to in the next steps.)
5) Go back to the sample page. Find the editor code. It starts and ends with a cfscript tag.
6) Select the FCKedotro code including the open and close cfscript tags and copy it, then paste it between the comments I left in my real page.
This has worked for me. But remember that Dreamweaver will not show you anything where FCKeditor will appear in the live page.
This will ge the standard editor working, any customization like removing toolbar icons will require reading the FCKeditor documents. For me, the (as a non-programmer) the key is to change only one thing at a time and test it before going on to the next thing I want to change.
RE: Dreamweaver CFM help
RE: Dreamweaver CFM help
I'll explain this once more (only once):
The basepath is the path to the directory that contains fckeditor.cfc, relative from your webroot.
So, if you have this kind of folder structure:
C:\
|- InetPub\
|- wwwroot\
|- MyTestApp\
|- FCKeditor\
|- fckeditor.cfc
|- fckconfig.js
|- ...
|- editor\
wwwroot being your webroot.
Your value for basepath should be:
"/MyTestApp/FCKeditor/";
The code you mentioned is just to make the sample page work and needs to be changed to work outside the _samples folder.
RE: Dreamweaver CFM help
The line:
fckEditor.instanceName = "myEditor";
represents the name of the field in your form.
That is to say that you will handle the data from the FCKeditor as #form.myEditor#.