4 Including or Calling Other Documents

The biggest benefit of STML documents is that you can reuse them inside other STML documents. We call these embeddable STML documents components. They have a different file extension: while your regular STML documents end with the extension of the kind of output they generate (like .html), all STML component documents end with the file extension .inc for include components, .comp for regular components, (or .dcmp for data components; more about those later).

If you have a block of HTML that must be included on every page of your website, make it an STML component, and then your other STML templates can embed the template in their own output. This lets you use an efficient, modular design when building your website.

There are two very different ways to embed an STML document in another one: by including the embedded template's STML code, or by calling it as an STML component. Let's examine the differences between include and component in the next sections.


Subsections