(7 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
=== Step 1 === | === Step 1 === | ||
− | Suppose that the editor is installed in the /fckeditor/ path of your web site. The first thing to do is to create an unique session file for the AFP - e.g. a file called fck.afpa | + | Suppose that the editor is installed in the /fckeditor/ path of your web site. The first thing to do is to create an unique session file for the AFP - e.g. a file called fck.afpa |
+ | <pre><application ID="fck"/></pre> | ||
+ | === Step 2 === | ||
− | <pre> | + | Now the FCKeditor is available and ready to use. So, just insert the following code in your page to create an instance of the editor inside a <FORM>: |
− | + | <pre><form action="sampleposteddata.afp" method="post" target="_blank"> | |
− | + | <% | |
− | = | + | sBasePath="/fckeditor/" && <-- Change this to your local path |
− | + | lcText=[This is some <strong>sample text</strong>. You are using ] | |
− | + | lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | lcText=[This is some | ||
− | lcText=lcText+[ | ||
oFCKeditor = CREATEOBJECT("FCKeditor") | oFCKeditor = CREATEOBJECT("FCKeditor") | ||
oFCKeditor.fckeditor("FCKeditor1") | oFCKeditor.fckeditor("FCKeditor1") | ||
− | oFCKeditor.BasePath | + | oFCKeditor.BasePath = sBasePath |
− | oFCKeditor.cValue | + | oFCKeditor.cValue = lcText |
? oFCKeditor.Create() | ? oFCKeditor.Create() | ||
− | % | + | %></pre> |
− | </pre> | + | "FCKeditor1" is the name used to post the editor data on forms. |
− | |||
− | "FCKeditor1" is the name used to post the editor data on forms. | ||
=== Step 3 === | === Step 3 === | ||
− | The editor is now ready to be used. Just open the page in your browser to see it at work. | + | The editor is now ready to be used. Just open the page in your browser to see it at work. |
=== Sample code === | === Sample code === | ||
The complete sample without HTML Overhead - find the full sample in your Samples directory. | The complete sample without HTML Overhead - find the full sample in your Samples directory. | ||
+ | <pre><html><head></head><body> | ||
+ | <form action="sampleposteddata.afp" method="post" target="_blank"> | ||
+ | <% | ||
+ | sBasePath="/fckeditor/" && <-- Change this to your local path | ||
+ | lcText=[This is some <strong>sample text</strong>. You are using ] | ||
+ | lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.] | ||
+ | oFCKeditor = CREATEOBJECT("FCKeditor") | ||
+ | oFCKeditor.fckeditor("FCKeditor1") | ||
+ | oFCKeditor.BasePath = sBasePath | ||
+ | oFCKeditor.cValue = lcText | ||
+ | ? oFCKeditor.Create() | ||
+ | %> | ||
+ | <input type="submit" value="Submit"> | ||
+ | </form> | ||
+ | </body></html></pre> | ||
+ | |||
+ | == Handling the posted data == | ||
+ | |||
+ | The editor instance just created will behave like a normal <INPUT> field in a form. It will use the name you've used when creating it (in the above sample, "FCKeditor1"). So, to retrieve its value you can do something like this: | ||
+ | <pre>lcData=request.form("FCKeditor1")</pre> | ||
+ | |||
+ | ==Additional information == | ||
− | + | * You can find some samples on how to use the editor in the "_samples/afp" directory of the distributed package. Also there is a complete class template for Integration in a class | |
− | + | * Please notice, that the edited texts can not be larger than 64KB due to Browser post restrictions. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 12:26, 23 January 2008
It is very easy to use FCKeditor in your AFP web pages. All the integration files are available in the official distributed package. To start the integration follow the instructions below.
Contents
Integration step by step
Step 1
Suppose that the editor is installed in the /fckeditor/ path of your web site. The first thing to do is to create an unique session file for the AFP - e.g. a file called fck.afpa
<application ID="fck"/>
Step 2
Now the FCKeditor is available and ready to use. So, just insert the following code in your page to create an instance of the editor inside a <FORM>:
<form action="sampleposteddata.afp" method="post" target="_blank"> <% sBasePath="/fckeditor/" && <-- Change this to your local path lcText=[This is some <strong>sample text</strong>. You are using ] lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.] oFCKeditor = CREATEOBJECT("FCKeditor") oFCKeditor.fckeditor("FCKeditor1") oFCKeditor.BasePath = sBasePath oFCKeditor.cValue = lcText ? oFCKeditor.Create() %>
"FCKeditor1" is the name used to post the editor data on forms.
Step 3
The editor is now ready to be used. Just open the page in your browser to see it at work.
Sample code
The complete sample without HTML Overhead - find the full sample in your Samples directory.
<html><head></head><body> <form action="sampleposteddata.afp" method="post" target="_blank"> <% sBasePath="/fckeditor/" && <-- Change this to your local path lcText=[This is some <strong>sample text</strong>. You are using ] lcText=lcText+[<a href='http://www.fckeditor.net/'>FCKeditor</a>.] oFCKeditor = CREATEOBJECT("FCKeditor") oFCKeditor.fckeditor("FCKeditor1") oFCKeditor.BasePath = sBasePath oFCKeditor.cValue = lcText ? oFCKeditor.Create() %> <input type="submit" value="Submit"> </form> </body></html>
Handling the posted data
The editor instance just created will behave like a normal <INPUT> field in a form. It will use the name you've used when creating it (in the above sample, "FCKeditor1"). So, to retrieve its value you can do something like this:
lcData=request.form("FCKeditor1")
Additional information
- You can find some samples on how to use the editor in the "_samples/afp" directory of the distributed package. Also there is a complete class template for Integration in a class
- Please notice, that the edited texts can not be larger than 64KB due to Browser post restrictions.