Template Syntax Demo

< Back to demos

Template syntax demo
WysiwygPro's can process basic template tags.

In this demo we have configured a template tag {site_url} that the editor should use instead of the URL of this website. To test this switch to source view and look at the source of the image in the center of the document.

To enable WYSIWYG editing you must be using a supported browser, however you may still edit the raw HTML code in the above textarea. For a full list of supported browsers please see http://www.wysiwygpro.com/browsers/

Source code:

<?php
include_once('wysiwygPro/wysiwygPro.class.php');

// create a new WysiwygPro instance
$editor = new wysiwygPro();

// load base configuration
$editor->loadPlugin('demoConfig');

// give the editor a name
$editor->name 'demo';

// load and configure the template filter plugin
$editor->loadPlugin('templateFilter');
$editor->plugins['templateFilter']->protect('{','}');
$editor->plugins['templateFilter']->assign('{site_url}','http://www.wysiwygpro.com');

// display the editor
$editor->display(700400);

?>

We are using a plugin "demoConfig" to apply shared configuration settings such as the file manager configuration. See the source code for this plugin.

WysiwygPro version 3.2.1
WysiwygPro.com