# Cheatsheet

Using a variable (can be done inside page, block, list, header, footer)

```
#$variable|key-of-my-variable$#
#$variable|title$#
#$variable|image$# - #$variable|image.alt$#
#$variable|link$# - #$variable|link.target$#
```

{% content-ref url="core-concepts/variables" %}
[variables](https://galaxy-cms.gitbook.io/project/core-concepts/variables)
{% endcontent-ref %}

Using if / else syntax (can be done inside page, block, list, header, footer)

{% content-ref url="core-concepts/template-engine-for-logic" %}
[template-engine-for-logic](https://galaxy-cms.gitbook.io/project/core-concepts/template-engine-for-logic)
{% endcontent-ref %}

```markup
{if=" '#$variable|title$#' != '' "}
    <h1>#$variable|title$#</h1>
{/if}

{if=" '#$variable|show-button$#' == '1' "}
    <!-- HTML for your button -->
{else}
    <!-- Alternative -->
{/if}

{if=" '#$variable|nb-column$#' == '1' "}
    <!-- code -->
{elseif=" '#$variable|nb-column$#' == '2' "}
    <!-- code -->
{elseif=" '#$variable|nb-column$#' == '3' "}
    <!-- code -->
{/if}
```

Using a block or a list (can be done inside a page, header, footer)

```
#$block|name-of-my-file$#
#$block|introduction$#

#$list|name-of-my-folder$#
#$list|hero$#
```

Using an include / partial

```
#$include|partial/path/to/my/file$#
#$include|partial/icons/arrow-left$#
#$include|partial/form/template-messages$#
```
