SSGO LogoDOCS

Conditionally show elements

To conditionally include elements of your templates inside of your build pages, simply use the if attribute.

For example, let's say that one of your creators is triggering a build page with the following data:

{
  foo: 'bar',
  howmuch: 42
}

Then you could conditionally display elements of your templates as follows:

<p if="foo === 'bar'">eeny</p>

<p if="howmuch === 42">meeny</p>

<p if="typeof howmuch === typeof foo">miny</p>

<p if="false">moe</p>

Your built page would look like that:

<p>eeny</p>

<p>meeny</p>

Something about this page is wrong? Edit it on GitHub.