User Tools

Site Tools


bigace:smarty_tags

Smarty Tags

Only for administration templates:

The following TAGs are only meant for developer who create own admin templates.

Extension TAGs

The following TAGs are available through Extensions, which are linked on their description page.

News Extension

Comments Extension

FAQ Extension

Smileys Extension

  • {smileys} - a modifier to parse smileys to icons in any string

Smarty Modifier

  • {filesize} - display a formatted filesize (from a bytes value)
  • {htmlspecialchars} - calls htmlspecialchars on the value
  • {text_input} - change “ (double quote) ' (single quote) to html entities and call stripslashes
  • {explode} - splits one var into x vars after every defined delimiter

Smarty Help

Read more about using Smarty int the official Docu at:

Writing own Smarty TAGs

Smarty plugin directory: /addon/smarty/plugins/

  • Lets assume you want to create the function/TAG {hello_world}
  • Create a file called /addon/smarty/plugins/function.hello_world.php
  • Place a function inside:
function smarty_function_hello_world($params, &$smarty) {
  echo "Hello World, says " . $params['name'] . "!";
}
  • Call {hello_world name=“Bob”} inside your template

The output would be:

Hello World, says Bob!
bigace/smarty_tags.txt · Last modified: 2011/04/12 21:50 by manuela