CMSimple.ORG

Valid HTML 4.01 Transitional

Dichos y Refranes Escribir al Reves

CMSimple.ORG > Installer's Manual > CMSimple Scripting

CMSimple Scripting

What is CMSimple Scripting

This allows you to add scripting to your content pages. The script is written on a single line enclosed between #CMSimple and #. The code used for 'CMSimple scripting' is normal PHP.

Two techniques are commonly used, the replacement of a variable, and the use of the preg_match function. Exceptions are the hide and remove commands, which are hardcoded into the cms.php source code.

The CMSimple code will be shown only in the editing mode, but on these help pages the parser has been tricked by inserting a font tag around the first '#' numsign. The executing code is not shown in Normal mode, or on the finished page.

Normally, only one #CMSimple string can be used in each page- though the contents of several scripts may be merged into one script.


How do I use CMSimple scripting

In the editor, switch to 'edit mode(layout)' and on a single line type

#CMSimple -----some code-------; #

CMSimple detects the string '#CMSimple' and interprets all the code until the final '#'.

Many useful examples are shown on the next few pages- copy and paste them and then remove the tags.


For example, the code below has changed the site title to 'hi dude' (but only on this page).

#CMSimple $GLOBALS['cf']['site']['title']='hi dude!'; #

Cut and paste this line into your page, remove the two <-font-> tags- save- and change to normal mode and see how it looks for you.

Important. When you copy'n'paste CMSimple code from these pages, you must remove the font tags! Do this in editing (HTML) mode


Please be aware: The CMSimple Scripting code on these pages is written for the build-in editor and may not work with other editors, ie. HTMLArea. Most editors have some auto-entity-conversion functionality, which might mess up the CMSimple Scripting code.

Submenu