Introduction to SAPI

Saurus API (SAPI) is an extension to the Smarty template engine . It uses all Smarty syntax and extends it with the Saurus specific tags. If you are unfamiliar with Smarty, we recommend to read at least basic syntax before continuing.

Templates
Templates define how Saurus CMS presents content. They consist of page layout and functionality. Basically a template is an HTML-document with SAPI-tags.

SAPI-tags
SAPI-tags are phrases that call out Saurus CMS function within the template.

SAPI-tags consist of:

  • Tag name
  • Tag parameters
  • Tag attributes (elements)

Example
Following code sample calls a content object "article". Tag parameter "name" defines how tag attributes are called. Tag attributes "title", "lead" and "body" place respective article elements into the HTML-code.

{init_article name=my_article}

<h1>{$my_article->title}</h1>

{$my_article->lead}<br>{$my_article->body}