Skip to content

Dwoo based frontend templates

webbird edited this page Nov 25, 2014 · 4 revisions

We are using Dwoo as our default template engine. It is quite easy to move from the old PHPlib templates used in WebsiteBaker to the new Dwoo engine.

Instead of direct function calls, for example page_content() or <?php page_content() ?> use {page_content()} without the <?php ?>. So, just add {} to the function call and remove <?php ?> and you're done.

Default template header

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
{get_page_headers()}
</head>

Default frontend login form

<form action="{$LOGIN_URL}" method="post">
  <input type="hidden" name="username_fieldname" value="{$username_fieldname}" />
  <input type="hidden" name="password_fieldname" value="{$password_fieldname}" />
  <fieldset class="account_form">
    <legend class="account_legend">{translate('Login')}</legend>
    {if $message}<div class="account_message">{$message}</div>{/if}
    <label class="account_label" for="{$username_fieldname}">{translate('Username')}:</label>
      <input type="text" class="account_input" name="{$username_fieldname}" id="{$username_fieldname}" maxlength="30" /><br />
      <script type="text/javascript">
    	var ref= document.getElementById("{$username_fieldname}");
    	if (ref) ref.focus();
      </script>
    <label class="account_label" for="{$password_fieldname}">{translate('Password')}:</label>
      <input type="password" class="account_input" name="{$password_fieldname}" id="{$password_fieldname}" maxlength="30" /><br />
    <input type="submit" class="account_button" name="submit" value="{translate('Login')}"  />
  </fieldset>
</form><br />
<a href="{$FORGOT_URL}">{translate('Forgot your details?')}</a>
Clone this wiki locally