> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# $wsTestMode - Test mode

> Reference for $wsTestMode: check whether test mode is active and show test-specific content for new functions, designs or products before launch.

With the `$wsTestMode` module, you can check whether test mode is active and control content accordingly. In test mode, you can test new functions, designs, or products without them being visible to regular visitors. In this section, you will learn how to query the test mode and display test-specific content.

***

## Module overview

**Example / excerpt of** `$wsTestMode`

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{= $wsTestMode | json }}
```

**JSON output**

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
  "active": false,
  "debug": false
}
```

**Variables overview**

| **Variable** | **Type** | **Description**                                   |
| ------------ | -------- | ------------------------------------------------- |
| `active`     | bool     | Checks whether test mode is enabled.              |
| `debug`      | bool     | Checks whether debugging is enabled in test mode. |

***

## Templates

Using the template engine, certain content can be made specifically visible for test mode. This allows you to test special functions or designs without them being visible to regular visitors of the shop.

A special view template is required for password entry to activate test mode. By default, the name is `testMode.htm`, which is located in the `views` directory.

The template can be renamed. However, the new template name must then be stored in the configuration settings in the [admin interface](/en/admin-interface). The configuration option is located in the same place where the password for test mode can be stored and changed.

***

## Variables

### \$wsTestMode.active

Returns whether test mode is enabled.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ if $wsTestMode.active }}
    // Test mode is active
{{ /if }}
```

### \$wsTestMode.debug

Returns `true` if extended debugging is enabled. In debug mode, additional information such as variable values or loading times is displayed.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ if $wsTestMode.debug }}
    // Debugging is active
{{ /if }}
```

***

## Methods

No methods are available for `$wsTestMode`.

***

## Actions

No actions are available for `$wsTestMode`.

***

## Examples for using test mode

### Link to activate global test mode

The link can be sent once you have informed the shop operator that changes have been integrated in test mode and that they can view them via the following link:

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
https://www.beispielshop.de/?wsvc=View&view=testMode.htm
```

### Check whether test mode is active

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{{ if $wsTestMode.active }}
   This content is only visible in test mode
  {{ else}}   
   This content is only visible in live mode   
{{ /if }}
```

### Deactivating global test mode

An option to deactivate test mode can also be offered directly in the online shop in order to switch back to the online shop.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<form action="{{= $wsViews.current.url() }}" method="post">
  <input type="hidden" name="wscsrf" value="{{= $cActionTestModeOff.csrf }}">
  <input type="hidden" name="wsact" value="{{= $cActionTestModeOff.id }}">
  <input type="hidden" name="wstarget" value="/">
  <button name="wsact" value="{{= $cActionTestModeOff.id }}">Deactivate test mode</button>
</form>
```

More practical examples for implementing the test mode page can be found here:\
→ [Practical examples: test mode](/en/frontend/praxisbeispiele/testmodus)

***

## Related links

* [actions - Test mode](/en/konfiguration/actions-fehlertexte-e-mails/actions-testmodus)
* [Test mode](/en/frontend/praxisbeispiele/testmodus)
