Online editor
From phpCMS
Contents |
[edit] Using the online editor
[edit] General information
With the built-in online editor content files can be edited directly via almost any web browser. By default phpCMS works with text fields and text areas where the content to be edited is displayed.
With a few modifications you can also integrate a WYSIWYG online editor.
[edit] Preparing the pages for online editing
To use the online editor, you have to make the following small modifications in the template files.
You can also find a short introduction to the online editor within the editor itself located at the demo site (/demo/editor-help.htm).
- Insert the tag <START_EDIT> in the template file above the area which later shall be editable. If you only want to edit the content area, you best insert the <START_EDIT> tag directly above the content area.
- Underneath the editable area (or at the beginning of the footer template) you need to insert the tag <END_EDIT>. Once the editor has been started, you will see at this place the buttons for editing, previewing, and saving the page and for logout from the online editor.
- All fields which shall be editable, are represented in the templates by a placeholder with some additional parameters defining the type and size of the editing fields:
- To define a single line editing field (e.g. to edit the page title), the parameters needed are: EDITTYPE="TEXT" and SIZE="nn" (where "nn" represents the maximum number of characters allowed). The keyword "EDITTYPE" defines the type of editor field, with the keyword "SIZE" you set its width.
The whole placeholder for an editable page title could look like this:
{TITLE EDITTYPE="TEXT" SIZE="25"}
- For a multi line input field (text area), the necessary additional parameters are EDITTYPE="TEXTAREA" for the type and ROWS="nn" for setting the number of lines (height) and COLS="nn" for setting the columns (width). For example, a placeholder for the page content could be noted as follows:
{CONTENT EDITTYPE="TEXTAREA" ROWS="20" COLS="70"} - You can use these placeholders for any other content field in your templates, so a more neutral notation for an editable text area would be
{FIELDNAME EDITTYPE="TEXTAREA" ROWS="20" COLS="70"}.
- To define a single line editing field (e.g. to edit the page title), the parameters needed are: EDITTYPE="TEXT" and SIZE="nn" (where "nn" represents the maximum number of characters allowed). The keyword "EDITTYPE" defines the type of editor field, with the keyword "SIZE" you set its width.
- Optionally you can use the alternative instruction {EDITLINE} in the template.
- With the {EDITLINE} tag you can include sub templates (similar to the {TEMPLATE} instruction) that are only effective during editing.
Example (from the phpCMS demo): {EDITLINE FILE="start_edit.tpl"} >, used here instead of the <START_EDIT> tag. - This can be used to display user help for the editor or other useful information, or to display and open for editing the field holding the page title as this is normally located in the <head> </head> block of the HTML page and thus not accessible for the online editor (unless repeated as a heading in the page, e.g. for search engine optimization).
- The {EDITLINE} tag can also be used with the <END_EDIT> tag.
- Important: Do not forget to put the <START_EDIT> or <END_EDIT> tag, whichever you replaced by the {EDITLINE} tag, into the included editing sub template!
- With the {EDITLINE} tag you can include sub templates (similar to the {TEMPLATE} instruction) that are only effective during editing.
[edit] Calling the online editor
The online editor is protected by a login procedure requiring a password of at least 6 characters, which you have to set in the governing project file.
Look for (or add, if not existing) an entry like EDITPASSWORD := MyPassword.
Instead of "MyPassword" you should of course use your own password. Since phpCMS version 1.2.0 also multiple, comma separated passwords can be used.
This can be useful, if you have different editors, each one responsible for a different area (i.e. group of content related pages) on your site but want to grant the webmaster access to all those pages with a single login.
A possible scenario:
EDITPASSWORD := WebmasterPass, Editor1Pass, DeputyEditor1Pass for area 1,
EDITPASSWORD := WebmasterPass, Editor2Pass, DeputyEditor2Pass for area 2,
EDITPASSWORD := WebmasterPass, Editor3Pass, DeputyEditor1Pass for area 3, and so on.
The downside of this is that you have to maintain one project file per editor, all identical but for the password entry (unless, of course, if the areas of the web site differ not only in the responsible editor, but in other things too, e.g. language).
The online editor needs to be enabled explicitly via the configuration page in the phpCMS GUI.
By default the online editor is deactivated in a new phpCMS installation!
To edit a page via the online editor, you have to call the page with the additional parameter ?phpcmsaction=edit added to the URL:
http://www.your-server.org/index.html?phpcmsaction=edit for Stealth Mode or
http://www.your-server.org/parser/parser.php?file=/index.html&phpcmsaction=edit for non-stealth mode.
If everything has been set up correctly, you should now see a login screen for the editor password and - after a successful login – the page with a button for editing the page, displayed where you have placed the <END_EDIT> tag in your template.
Note: If you share your computer with others, do not forget to log off once your editing work is finished
[edit] Important notices
- If you should encounter problems with switching to the editor mode try to empty your browser's cache!
- phpCMS will replace the tags <START_EDIT> and <END_EDIT> as well as the area between them by a form (HTML <FORM> block) on generating the page during editing mode.
To avoid problems pay attention to not to have any other <FORM> between the <START_EDIT> and <END_EDIT> in your template, as it will cause an illegal nesting of forms, and no scripts either.
If necessary, you can define more then one editable area on your page by ending the editable area before a "no-go zone" with an <END_EDIT> tag and after that zone starting a second editable area with a new <START_EDIT> tag.
[edit] Integrating a WYSIWYG editor
In the phpCMS support forum, "Iggi" and "nick77" explained how to include the free WYSIWYG editors "Spaw" and "FCKeditor" in phpCMS.
You can find these explanations in the Tutorials section of this documentation.
The steps are generally:
- download the editor software (pay attention to get the correct version!),
- uncompress the downloaded archive and load the files into a directory of their own on your server underneath the phpCMS directory (i.e. /parser/ in the default installation), maintaining their directory structure,
- configure the editor according to the installation instructions,
- apply the editor specific instruction for integration in phpCMS,
- adapt your project and template files as explained above, but instead of using fields like {CONTENT EDITTYPE="TEXTAREA" ROWS="20" COLS="70"} use {CONTENT EDITTYPE="WYSIWYG"}
- enable the phpCMS editor mode
Main Page: User Documentation MainPage
« Previous Page: How to work with the full text search engine | Top Page: How to work with phpCMS | Next Page: How to get help for debugging »

