SUIT Framework

Scripting Using Integrated Templates

Try It - Templating

12/21/2010: SUIT 2.0.2 and Rulebox 1.1.1 released.

Our Try It Editor can be used to play around with some Rulesets live on this site. Learn more about it on its Docs article.

HTML

Brandon's Site - Examples

Welcome, Brandon!

Who's Online?

Brandon , Chris


Copyright © 20XX Brandon Evans.

Text
<h1>Brandon's Site - Examples</h1>

<p>Welcome, Brandon!</p>


<fieldset>
    <legend>Who's Online?</legend>
    <p>
        
        
        <strong>
        
        Brandon
        </strong>
        
        ,
        
        <del>
        Chris
        
        </del>
        
    </p>
</fieldset>
<hr />
<p>Copyright © 20XX Brandon Evans.</p> 

Template:

Entities Insensitive Line Break Log Mismatched Unclosed

Escape:

PHP
<?php
$templating->var->username = 'Brandon';
$templating->var->loggedin = true;
$templating->var->members = array
(
    array
    (
        'name' => 'Brandon',
        'admin' => true,
        'banned' => false
    ),
    array
    (
        'name' => 'Chris',
        'admin' => false,
        'banned' => true
    )
);
$templating->var->owner = 'Brandon';
$templating->var->ownerfull = 'Brandon Evans';
?>
Python
from rulebox.templating import var
var.username = 'Brandon'
var.loggedin = True
var.members = [
    {
        'name': 'Brandon',
        'admin': True,
        'banned': False
    },
    {
        'name': 'Chris',
        'admin': False,
        'banned': True
    }
]
var.owner = 'Brandon'
var.ownerfull = 'Brandon Evans'
header.tpl
<h1>[var]owner[/var]'s Site - [var]title[/var]</h1>
footer.tpl
<hr />
<p>Copyright &copy; 20XX [var]ownerfull[/var].</p>