PHPBuilder - Integrating Ektron eWebEditPro in PHP



RSS Twitter
Snippets Html

Integrating Ektron eWebEditPro in PHP

by: Daniel
|
October 29, 2003

Version: 4.0

Type: Sample Code (HOWTO)

Category: HTML

License: WebSite Only

Description: Ektron eWebEditPro, the leading multi-language, browser-based, WYSIWYG Web content authoring tool offers business users a familiar editing toolbar for authoring content without needing to know HTML -- which broadens the organization's authoring base and lowers costs. With Ektron eWebEditPro, Webmasters and IT professionals maintain stylistic control over their Web content, yet they no longer need to perform simple routine editing tasks. This cross-platform tool works with leading content management solutions and all dynamic Web application servers. Replaces a text area field. The following lines will show you how to integrate Ektron's award-winning WYSIWYG editor into your site with just a few lines of code. To learn more, visit www.ektron.com



Ektron eWebEditPro, the leading multi-language, browser-based, WYSIWYG Web content authoring tool offers business users a familiar editing toolbar for authoring content without needing to know HTML -- which broadens the organization's authoring base and lowers costs. With Ektron eWebEditPro, Webmasters and IT professionals maintain stylistic control over their Web content, yet they no longer need to perform simple routine editing tasks. This cross-platform tool works with leading content management solutions and all dynamic Web application servers. Replaces a text area field. 
The following lines will show you how to integrate Ektron's award-winning WYSIWYG editor into your site with just a few lines of code.

Ektron provides sample code to simplify the integration of eWebEditPro 4 with PHP. You can insert eWebEditPro into an PHP page just as easily as you can insert a text area field into an HTML page. Download eWebEditPro 4 and a 30-day trial license (including sample code and documentation). The following instructions explain how to insert eWebEditPro into a PHP page.

Integrating eWebEditPro 4 in a PHP Page

To place eWebEditPro on a PHP page, it must contain these actions:
1. Include the ewebeditpro.php file.          
2. Set up a form.          
3. Place the editor on the form.          
4. Add a submit button. 


1. Include a Reference to ewebeditpro.php
Your PHP page must include a reference to the ewebeditpro.php file. Place the #Include line within the pages head tags. 

Ektron recommends using an absolute path. To indicate an absolute path, use this syntax:
 <head>
  <?php include("/ewebeditpro4/ewebeditpro.php"); ?>
 </head>

  
2.  Set Up a Form
When setting up a form, follow these steps.
a. Declare a form.                                                                
b. Enter a URL as the action. The URL defines the page that manipulates the users input when the user presses the submit button.                                                                 
c. Enter "Post" as the method.
 
Here is a sample form declaration:
 <form action="multiedit.php?preview" method="POST">


3.  Place the Editor on the Form
To place the editor on a PHP page, enter a line with the following elements within the form tags:

 <?php echo eWebEditProEditor("field name", width, height,"$initial_content"); ?>
 
Where:

field name: Enter the name of the field that stores content within quotes (" "). It does not matter what the name is, but the field name on the page that retrieves the content must match this name.
 
width, height: Enter the width and height of the editor in percent or pixels.
If a percent, enclose the value in quotes (" ") and follow it with a percent sign (%), for example 50%. If pixels, quotes are optional, for example, 500. 

initial content: If you want some text to appear in the editor the first time a user views it, you can enter text or a variable that contains the text.
To enter text, enclose it within quotes (" ").
To enter a variable, define it elsewhere in the file. 
   

Here is an example of a line that calls the editor. (In this example, the initial content is defined in the variable strContent1, which is defined elsewhere in the file).
 <?php echo eWebEditProEditor("TextHTML1", "100%", 250, strContent1); ?>

 
4. Add a Submit Button
Add a standard HTML submit button that allows the user to send the content to the Web server after entering it. Here is an example of a line that contains a submit button.
 <input type="submit" name="btnSubmit" value="Preview">
 

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Daniel

Comment:



Comment:

(Maximum characters: 1200). You have characters left.