Pages and blocks


The functionality of static pages and common blocks allows building a relatively small website using only Site app without installing or integrating other Webasyst applications.


Static content pages is a standard part of any website, whether a simple demo resource, a blog, a photo gallery, or an online store; therefore, static pages creation and editing tools are available only in Site app to avoid the necessity of duplicating equal functionality in several applications.

For example, an application named "Shop" can hardly exist without such pages as "About us" or "Shipping terms". The developer is free to implement his own mechanism of creating static pages in his application; however, it is convenient to use the existing infrastructure provided by Site app.

In the content of a static page you can use all features of the Smarty engine and the tools provided by the cheat sheet. Below is an example illustrating how you can display different information to users of different operating systems installed on their computers:

{if $wa->userAgent("platform") == 'windows'}
  <a href="...">Download the Windows installer</a> (.exe, 3 MB)
{elseif $wa->userAgent("platform") == 'mac'}
  <a href="...">Get it in the Mac App Store</a>

The WYSIWYG editor of HTML pages is powered by redactor editor.

Common blocks

Common blocks are portions of HTML/Smarty code, which you can include in the contents of website pages and design templates as "subtemplates". For creation of such blocks the same Smarty features and cheat sheet tools are accessible as in the template files editor.

Common blocks are useful for websites powered by several independent applications, each of which utilizes its own design theme. In order to apply common design to all applications (or rather their settlements), it is handy to create some elements as common blocks and include them in template files instead of copying&pasting the same code. For example, this is convenient to create a website header or footer, to embed a JavaScript snippet (e.g., web couter), etc. The block ID may contain only Latin letters and digits; e.g., header, footer, google_analytics.