Dwoo is a modern, flexible and oriented object template engine for PHP, which among other things allows you to add some logic to templates. The Dwoo Template Engine Plugin for Contact Enhanced allows you to use Dwoo template engine in Contact Enhanced templates. 

How to get it

Dwoo Template Engine Plugin is included in Contact Enhanced PRO for version 3.8 and newer

Installation and Usage

The plugin is located in the Bonus package inside the Contact Enhanced's downloadble zip archive. The installation is just like any other Joomla extension. Go to Extensions -> Manage -> Install, then upload and install the extension.

Go to Extensions -> Plugin manager, search dor Dwoo and enable it;

Then go to Components -> Contact Enhanced -> Templates and edit your template so you can use the template engine.

Syntax

Each Contact Enhanced Form Field Alias becames a variable in the HTML Template. For the example below let's assume you have a Contact Enhanced Form with the following Field's

Field TypeField AliasField Value type
Radio box referrer string
Checkbox subscriptions array

Code in Contact Enhanced's HTML Template:

{* This is a comment *}
{* We will add special message if the referrer was a friend *}
{if $referrer == 'Friend'}
	A text to display in the template and then display an image:
	<img src="/https://yourdomain.com/path/to/image.png" />
{/if}

{* Checkboxes fields will result in an array of values, so we have to make sure the field is submitted *}
{if is_array($subscriptions)}
	{$subscriptions_label}:
	<ul>
	{foreach $subscriptions sub}
		<li>{$sub}</li>
	{/foreach}
	</ul>
{/if}

For a full syntax documentation, please read the Dwoo Documentation page.