Template tags control the output of a template in various ways, and allow the combination of multiple templates into a single output.

include

Includes the contents of one template in another, by name. In Adxstudio Portals, the source of this other template will generally be a Web Template. This allows for the reuse of common template fragments in multiple places.

When a template is included in another, the included template will have access to any variables defined in the parent template.

{% include 'My Template' %}

It's also possible to pass any number of named parameters to the include tag. These will then be defined as variables in the included template.

{% include 'My Template' a:x, b:y %}

block

Used in conjunction with extends to provide template inheritance. See extends for usage.

extends

Used in conjunction with the block tag, provides template inheritance. This allows multiple templates to use a shared layout, while overriding specific areas of the parent layout.

In Adxstudio Portals, the parent template name provided to the tag will generally refer to the name of a Web Template.

When extends is used, it must be the first content in the template, and can only be followed by one or more block tags.

If a block defined in the parent template is not overridden, its contents in the parent template (if any) will be rendered.

Two Column Layout (Web Template)
<div class="container">
  <div class="page-heading">
    <ul class="breadcrumb">
      {% for crumb in page.breadcrumbs -%}
        <li>
          <a href="{{ crumb.url }}">{{ crumb.title }}</a>
        </li>
      {% endfor -%}
      <li class="active">{{ page.title }}</li>
    </ul>
    <div class="page-header">
      <h1>{{ page.title }}</h1>
    </div>
  </div>
  <div class="row">
    <div class="col-md-8">
      {% block content %}
        {{ page.adx_copy }}
      {% endblock %}
    </div>
    <div class="col-md-4">
      {% block sidebar %}{% endblock %}
    </div>
  </div>
</div>
Extending Two Column Layout
{% extends 'Two Column Layout' %}

{% block content %}
  <div class="page-copy">
    {{ page.adx_copy }}
  </div>
{% endblock %}

{% block sidebar %}
  <ul>
    {% for child in page.children %}
      <li>
        <a href="{{ child.url }}">{{ child.title }}</a>
      </li>
    {% endfor -%}
  </ul>
{% endblock %}

comment

Allows you to leave un-rendered code inside a Liquid template. Any content within the block will not be rendered, and any Liquid code within will not be executed.

Code
Hello{% comment %}, {{ user.fullname }}{% endcomment %}. My name is HAL 9000.
Output
Hello. My name is HAL 9000.

raw

Allows output of Liquid code on a page without having it parsed and executed.

Code
Hello{% raw %}, {{ user.fullname }}{% endraw %}. This is HAL 9000.
Output
Hello, {{ user.fullname }}. My name is HAL 9000.