> For the complete documentation index, see [llms.txt](https://docs.rafflex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rafflex.io/advanced/twig-templating/settings-variables.md).

# Settings Variables

The settings variable is available in every Twig template. It gives you your site name, brand colours, logos, social links and review scores, straight from your Settings, so your custom sections updat

Every Twig template on your site can use a ready made variable called `settings`. It holds your site name, brand colours, logos, social links and review scores, taken straight from your **Settings** pages.

Using these instead of typing the values into your template has two big advantages:

* **Your custom sections always match the rest of your site.** If you change your primary colour or upload a new logo, every template that uses `settings` updates by itself.
* **There is nothing to set up.** You do not need to create these variables. They are always there.

`settings` works in:

* the [Custom Twig Block](/advanced/twig-templating/custom-twig-block.md)
* every block's **Custom Twig (Advanced)** layout, including the [Custom Twig Product Grid](/advanced/twig-templating/custom-twig-product-grid.md) and [Custom Twig Slider](/advanced/twig-templating/custom-twig-slider.md)
* custom headers and footers (see [Header and Footer Variables](/advanced/twig-templating/header-and-footer-variables.md))

***

### Usage <a href="#usage" id="usage"></a>

Type `settings.` followed by the name of the value you want:

```twig
<h2>Welcome to {{ settings.site_name }}</h2>
<div style="background: {{ settings.primary_color }};">...</div>
<a href="{{ settings.facebook_url }}">Facebook</a>
```

Values you have not filled in are empty, so wrap optional ones in an `if`:

```twig
{% if settings.email_logo_url %}
  <img src="{{ settings.email_logo_url }}" alt="{{ settings.site_name }}">
{% endif %}
```

***

### Available Settings <a href="#available-settings" id="available-settings"></a>

There are 18 settings in total. Each table below shows where the value comes from, so you know where to change it.

All of these settings are in the **admin panel**, in the left hand menu under **Content**, then **Settings**. Click **Save Settings** at the bottom of the settings page after any change.

#### Colours <a href="#colors" id="colors"></a>

Set on the **Branding** settings page (titled **Branding & Theme**), in the **Color Theme** section. See [Choose Site Colours](/customise-your-site/choose-site-colours.md).

| Variable                     | What it contains                   | Where it is set        | Example                               |
| ---------------------------- | ---------------------------------- | ---------------------- | ------------------------------------- |
| `settings.primary_color`     | Your main brand colour             | **Primary Color**      | `#4F45E4`                             |
| `settings.background`        | Your site's background colour      | **Background Color**   | `#111827`                             |
| `settings.button_text_color` | The colour of text on your buttons | **Button Text Colour** | `#ffffff` (Light) or `#111827` (Dark) |

{% hint style="warning" %}
**`settings.background` only gives a colour code for some backgrounds.** The first five options in the **Background Color** list (**White**, **Light**, **Purple**, **Dark** and **Black**) give a colour code such as `#111827`. The named palettes further down the list (such as **Slate**, **Zinc**, **Emerald** or **Rose**) give the palette's name instead, for example `slate`. A name like `slate` does not work as a colour in your styles at all, and a name like `red` or `blue` gives a plain web colour that will not match your site. **Purple** appears twice in the list: the first one gives a colour code, but the second one, among the named palettes, gives the name `purple`. If you use one of those palettes, create a **Color** variable in your Custom Twig Block for the background instead.
{% endhint %}

`settings.primary_color` and `settings.button_text_color` are designed to go together. Use them as a pair for buttons, so the text is always readable against your brand colour:

```twig
<a href="{{ product.url }}" style="background: {{ settings.primary_color }}; color: {{ settings.button_text_color }};">Enter Now</a>
```

#### Logos and Icons <a href="#logos" id="logos"></a>

Each of these is the full web address of the image, ready to use in an `<img>` tag. If nothing has been uploaded, the value is empty. See [Add Your Logo](/customise-your-site/add-your-logo.md).

| Variable                   | What it contains                                                                     | Where it is set                                                                                                   |
| -------------------------- | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
| `settings.logo_url`        | Your main site logo                                                                  | **Branding** page, **Site Logo**                                                                                  |
| `settings.email_logo_url`  | Your email logo (empty unless you have uploaded one)                                 | **Branding** page, **Email Logo Override**                                                                        |
| `settings.wallet_icon_url` | Your custom icon, shown next to credit balances (empty unless you have uploaded one) | **Branding** page, **Custom Icon**                                                                                |
| `settings.favicon_url`     | Your favicon, the small icon shown in browser tabs                                   | **SEO** page, **Site Icons** section, **Fav Icon**. See [SEO Settings](/marketing/website-tools/seo-settings.md). |

{% hint style="info" %}
**Tip:** `settings.email_logo_url` is usually a darker version of your logo, made for white email backgrounds. That makes it a handy choice if you build a section with a white or light background.
{% endhint %}

#### Branding <a href="#branding" id="branding"></a>

| Variable                 | What it contains                                     | Where it is set                                                                                                                             | Example                     |
| ------------------------ | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
| `settings.site_name`     | Your site's name                                     | **General** page, **Site Information** section, **Site Name**. See [General Settings](/additional-settings/settings/general-settings.md).   | `My Raffle Site`            |
| `settings.footer_text`   | The text shown at the bottom of every page and email | **General** page, **Site Information** section, **Site Footer Text**                                                                        | `© 2026 My Raffle Site Ltd` |
| `settings.currency_icon` | Your currency symbol: `£` for GBP or `€` for EUR     | **Checkout** page, **Payment Methods** section, **Currency**. See [Order & Cart Settings](/additional-settings/order-and-cart-settings.md). | `£`                         |

`settings.currency_icon` is useful for numbers that do not already include a currency symbol, such as an instant win's `prize_value`:

```twig
<p>Worth {{ settings.currency_icon }}{{ winner.prize_value }}</p>
```

#### Social Links <a href="#social-urls" id="social-urls"></a>

Set on the **Marketing** settings page (titled **Marketing & Social**), in the **Social Links** section. See [Connect Your Social Accounts](/essential-settings/connect-your-social-accounts.md).

| Variable                 | Where it is set                   |
| ------------------------ | --------------------------------- |
| `settings.facebook_url`  | **Facebook Link**                 |
| `settings.instagram_url` | **Instagram Link**                |
| `settings.tiktok_url`    | **TikTok Link**                   |
| `settings.twitter_url`   | **Twitter Link** (your X profile) |
| `settings.youtube_url`   | **YouTube Link**                  |

{% hint style="warning" %}
**Clear the links for platforms you do not use.** New sites start with each platform's home page filled in (for example `https://www.facebook.com/`). Your template treats those as real links, so an `if` check will still show them. Clear any field you do not need on the **Marketing** settings page and click **Save Settings**.
{% endhint %}

#### Review Scores <a href="#review-scores" id="review-scores"></a>

Set on the **Marketing** settings page (titled **Marketing & Social**), in the **Reviews & Trust** section. See [Reviews and Trust](/marketing/website-tools/reviews-and-trust.md).

| Variable                         | What it contains                           | Where it is set           | Starts as                |
| -------------------------------- | ------------------------------------------ | ------------------------- | ------------------------ |
| `settings.trustpilot_score`      | Your Trustpilot star rating                | **TrustPilot Score**      | `0`                      |
| `settings.trustpilot_url`        | The address of your Trustpilot review page | **TrustPilot Link**       | The Trustpilot home page |
| `settings.facebook_review_score` | Your Facebook rating                       | **Facebook Review Score** | `5.0`                    |

Your scores are whatever you type into these fields. They do not update by themselves, so remember to change them when your rating changes.

***

### Example: Dynamic Styling <a href="#example-dynamic-styling" id="example-dynamic-styling"></a>

A welcome section that uses your brand colours, so it always matches your theme:

```twig
<style>
  .welcome-section {
    background: {{ settings.primary_color }};
    color: {{ settings.button_text_color }};
    padding: 40px 20px;
    text-align: center;
  }
  .welcome-btn {
    display: inline-block;
    margin-top: 15px;
    background: {{ settings.button_text_color }};
    color: {{ settings.primary_color }};
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
  }
</style>

<section class="welcome-section">
  {% if settings.logo_url %}
    <img src="{{ settings.logo_url }}" alt="{{ settings.site_name }}" style="max-height: 60px; margin: 0 auto;">
  {% endif %}
  <h2>Welcome to {{ settings.site_name }}</h2>
  <a href="/results" class="welcome-btn">See Our Winners</a>
</section>
```

### Example: Social Links Section <a href="#example-social-links-section" id="example-social-links-section"></a>

Only the platforms you have filled in are shown:

```twig
<div class="social-links">
  {% if settings.facebook_url %}<a href="{{ settings.facebook_url }}" target="_blank">Facebook</a>{% endif %}
  {% if settings.instagram_url %}<a href="{{ settings.instagram_url }}" target="_blank">Instagram</a>{% endif %}
  {% if settings.tiktok_url %}<a href="{{ settings.tiktok_url }}" target="_blank">TikTok</a>{% endif %}
  {% if settings.twitter_url %}<a href="{{ settings.twitter_url }}" target="_blank">X</a>{% endif %}
  {% if settings.youtube_url %}<a href="{{ settings.youtube_url }}" target="_blank">YouTube</a>{% endif %}
</div>
```

### Example: Trustpilot Badge <a href="#example-trustpilot-badge" id="example-trustpilot-badge"></a>

Shows your Trustpilot rating, but only once you have entered a score above 0:

```twig
{% if settings.trustpilot_score > 0 %}
  <a href="{{ settings.trustpilot_url }}" target="_blank" class="tp-badge">
    Rated {{ settings.trustpilot_score }} out of 5 on Trustpilot
  </a>
{% endif %}
```

### Example: Footer Line <a href="#example-footer-line" id="example-footer-line"></a>

```twig
<p class="small-print">{{ settings.footer_text }}</p>
```

***

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

<details>

<summary>My setting shows nothing</summary>

* Check the spelling. It must be `settings.` (with an "s") followed by the exact name from the tables above, for example `settings.primary_color`, not `settings.primary_colour`.
* Check the setting has a value on its **Settings** page and that you clicked **Save Settings**.
* If you have created your own variable called `settings` in a Custom Twig Block, it replaces these values. Rename your variable.

</details>

<details>

<summary>I changed a setting but my section has not updated</summary>

Your browser may be showing a saved copy of the page. Do a hard refresh (hold **Shift** and click the refresh button), or open the page in a private or incognito window.

</details>

<details>

<summary>My background colour is not working</summary>

You are probably using one of the named **Background Color** palettes, which gives a palette name rather than a colour code. See the warning in [Colours](#colors) above.

</details>

***

### AI Context <a href="#ai-context" id="ai-context"></a>

**For AI Assistants:** This documents the RaffleX global `settings` variable available in all Twig templates (Custom Twig Block, every block's "Custom Twig (Advanced)" layout, custom headers and footers).

**Availability:** Automatically available. No setup required. A user variable named `settings` in a Custom Twig Block overrides it.

**Settings keys (18 total):**

* Colours: `primary_color` (hex), `background` (hex for the first five options White/Light/Purple/Dark/Black, otherwise a palette name such as `slate` or `purple`, which is not usable as the site's actual background colour), `button_text_color` (`#ffffff` or `#111827`)
* Logos: `logo_url`, `email_logo_url`, `favicon_url`, `wallet_icon_url` (absolute URLs, empty string when not uploaded)
* Branding: `site_name`, `footer_text`, `currency_icon` (`£` or `€`)
* Social: `facebook_url`, `twitter_url`, `instagram_url`, `tiktok_url`, `youtube_url` (may contain the platform home page placeholder if not changed)
* Reviews: `trustpilot_score` (string, `0` when unused), `trustpilot_url`, `facebook_review_score`

**Usage:** Access via `{{ settings.key_name }}`. Use conditionals for optional values: `{% if settings.facebook_url %}...{% endif %}`. Pair `primary_color` with `button_text_color` for buttons.
