> ## 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.

# ST- (page state and navigation)

> Use bracketings to detect which page is currently displayed, how it was called and where in the category tree the buyer is.

A template runs in many places in the shop, often even the same template on several pages. For an include or a header area to adapt to this, it needs an answer to three questions: Which page am I on, how did I get here, and where in the product range am I right now.

This is exactly what the `ST-` tags on this page answer. The other states of the prefix are on separate pages.

* Reference: ST- (customer and login)
* Reference: ST- (checks in the order process)
* Reference: ST- (payment and express checkout)
* Reference: ST- (delivery, tax and multiple delivery)
* Reference: ST- (operating modes and technology)

> [!NOTE]
>
> All `ST-` tags are pure bracketings. They exist in a positive and a negative version, but neither as a single tag nor as a loop. In the overview table at the end, this is therefore the same for all tags.

## Which page the buyer is on

| Tag | Applies on |
| - | - |
| `ST-StartPage` | the start page |
| `ST-CatPage` | a category page |
| `ST-BasketPage` | the basket page |
| `ST-PlaceOrderPage` | the order overview page |
| `ST-LoginPage` | the login page |
| `ST-MultiDeliveryManagePage` | the management of multiple delivery addresses |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{ST-PlaceOrderPage}
   <p>Bitte prüfen Sie Ihre Angaben vor dem Absenden.</p>
{/ST-PlaceOrderPage}

{!ST-PlaceOrderPage}
   <p>Weiter einkaufen</p>
{/!ST-PlaceOrderPage}
```

> [!WARNING]
>
> The previous example for `ST-PlaceOrderPage` closes both areas with `{/ST-PlacedOrderPage}`, that is, with one **d** too many. This is a different tag name, so the area is never closed.

> [!NOTE]
>
> The main purpose of these tags is controlling includes. A header or footer area that is included on all pages uses them to hide the parts that get in the way on a specific page.

> [!WARNING]
>
> `ST-StartPage` only applies if the start page was called as the start page. A redirect to it, for example after login in a closed shop, and loading the start page template via a template link do **not** set this state. The template is then the same, but the state is different.

> [!NOTE]
>
> `ST-BasketPage` also applies if the basket page is reloaded via a background request.

> [!NOTE]
>
> `ST-LoginPage` exists in the shop system but is not described in the previous documentation. It adds the login page to the other page states.

## The order has been placed

`ST-PlacedOrder` does not distinguish by page but by point in time: it applies as soon as the order has been created successfully.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{ST-PlacedOrder}
   <!-- Zählpixel und Bestätigungstexte gehören hierher -->
{/ST-PlacedOrder}
```

> [!WARNING]
>
> In the explanatory text, the previous documentation uses the positive notation both times, even where it means the negative bracketing. The correct form is `{!ST-PlacedOrder}` for the case that the order has not yet been placed or an error has occurred.

> [!NOTE]
>
> An order is considered placed when the buyer has clicked the order button and no error occurred. If the process fails, the bracketing does not apply.

## How the page was called

| Tag | Applies if |
| - | - |
| `ST-Ajax` | the call was a background request |
| `ST-FormMethodGet` | the form was submitted via GET |
| `ST-Addr_Order` | the address or login page is displayed as part of an order |
| `ST-Addr_Manage` | the same page is displayed from the customer data management |
| `ST-Change` | a detail is being changed from the order overview |
| `ST-PR_Change` | a product is being changed from the basket |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{ST-Change}
   <input name="~BT-Addr_Change~" type="submit" value="Rechnungsadresse ändern">
{/ST-Change}

{!ST-Change}
   <input name="~BT-Addr_Back~" type="submit" value="Zurück">
   <input name="~BT-Addr_Next~" type="submit" value="Weiter">
{/!ST-Change}
```

> [!NOTE]
>
> `ST-Addr_Order` and `ST-Addr_Manage` are a pair. The same address page serves in the order process and in account management, and the two tags distinguish the two paths. This lets you label the buttons appropriately instead of offering "Continue to the next order step" in both cases.

> [!NOTE]
>
> `ST-Addr_Manage` exists in the shop system but is not described in the previous documentation.

> [!NOTE]
>
> `ST-FormMethodGet` is not described either. It applies if the form was submitted via GET and the session parameter is in the address. It is intended for templates that work with link optimisation and must take the browser's back button into account.

> [!NOTE]
>
> `ST-Ajax` is suitable for areas that should only be output in the response to a background request, for example an HTML fragment without a page skeleton.

## Where in the category tree

Four bracketings answer questions about the current category. All four require an argument.

| Tag | Applies if |
| - | - |
| `ST-CatIndex()` | the specified category index is the current one |
| `ST-CatTopIndex()` | the specified index is the current main category |
| `ST-CatLastTopIndex()` | the specified index is the most recently visited main category |
| `ST-CatLevel()` | the current category level is within the specified limits |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{ST-CatTopIndex(1-2344)}
   <link rel="stylesheet" href="/css/welt-der-schuhe.css">
{/ST-CatTopIndex(1-2344)}
```

`ST-CatLevel()` takes two limits separated by a comma. The first is the lower limit, the second the upper limit, and either of them may be left empty.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{ST-CatLevel(1,3)}
   <!-- Kategorieebene 1 bis 3 -->
{/ST-CatLevel(1,3)}

{ST-CatLevel(,4)}
   <!-- Kategorieebene höchstens 4, und ohne gewählte Kategorie ebenfalls -->
{/ST-CatLevel(,4)}

{ST-CatLevel(5,)}
   <!-- Kategorieebene mindestens 5 -->
{/ST-CatLevel(5,)}
```

> [!NOTE]
>
> Without a selected category, the level is zero. A bracketing with an open lower limit therefore applies, while one with a lower limit of one or more does not.

> [!WARNING]
>
> These four tags strictly require an argument. Empty parentheses make them an invalid tag. They are also invalid as a single tag and as a loop.

> [!WARNING]
>
> The previous example for `ST-CatIndex()` checks for `1-111` in the negative bracketing but describes the index `1-1234` below it. The example is self-contradictory.

> [!NOTE]
>
> `ST-CatLastTopIndex()` exists in the shop system but is not described in the previous documentation. It falls back on the most recently visited main category and is therefore useful on pages that have no category of their own, for example the basket.

> [!NOTE]
>
> `ST-CatIndex()` compares with the index of the current category, `ST-CatTopIndex()` with its top level. For a design per product range area, the main category is almost always the right choice.

## Around the displayed product

| Tag | Applies if |
| - | - |
| `ST-ParentProduct` | the product is the main product of a grouping |
| `ST-AlternativeProductData` | the alternative product data function is active |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{!ST-ParentProduct}
   <input type="text" name="~PR-Quantity_Input~" value="1">
   <input type="submit" name="~BT-Order~" value="In den Warenkorb">
{/!ST-ParentProduct}
```

> [!NOTE]
>
> A main product of a grouping cannot be ordered itself. The quantity field and order button therefore belong in the negative bracketing. In the shop system, the tag applies as soon as the product has subordinate products.

* Reference: APD- (alternative product data)
* Guide: Grouping products

## Deprecated tags

`ST-PR_FromCategory` was intended to indicate whether a product was called from a regular category, in order to hide paging and the way back to the list when the buyer came via the search or the basket.

> [!WARNING]
>
> The tag still exists in the shop system and checks an internal flag that apparently is no longer set in this version. The bracketing therefore does not apply, and no replacement is planned. Do not use it in new templates.

## Tags at a glance

| Tag | Single tag | Area tag | Negative area tag | Loop tag |
| - | - | - | - | - |
| `ST-StartPage` | – | yes | yes | – |
| `ST-CatPage` | – | yes | yes | – |
| `ST-BasketPage` | – | yes | yes | – |
| `ST-PlaceOrderPage` | – | yes | yes | – |
| `ST-LoginPage` | – | yes | yes | – |
| `ST-MultiDeliveryManagePage` | – | yes | yes | – |
| `ST-PlacedOrder` | – | yes | yes | – |
| `ST-Ajax` | – | yes | yes | – |
| `ST-FormMethodGet` | – | yes | yes | – |
| `ST-Addr_Order` | – | yes | yes | – |
| `ST-Addr_Manage` | – | yes | yes | – |
| `ST-Change` | – | yes | yes | – |
| `ST-PR_Change` | – | yes | yes | – |
| `ST-CatIndex()` | – | yes | yes | – |
| `ST-CatTopIndex()` | – | yes | yes | – |
| `ST-CatLastTopIndex()` | – | yes | yes | – |
| `ST-CatLevel()` | – | yes | yes | – |
| `ST-ParentProduct` | – | yes | yes | – |
| `ST-AlternativeProductData` | – | yes | yes | – |
| `ST-PR_FromCategory` | – | yes | yes | – |

All tags on this page are permitted on all templates. `ST-ParentProduct` requires an active product, the four category tags a loaded category. `ST-Change` and `ST-Addr_Order` only produce a meaningful result in the order process.

## Related topics

* Guide: Includes and template logic
* Reference: CAT- (categories)
* Reference: ST- (operating modes and technology)


## Related topics

- [Navigation](https://dokumentation.websale.de/en/v8s/navigation.md)
- [MDM- (Multiple delivery addresses)](https://dokumentation.websale.de/en/v8s/referenz/tags/mdm-mehrere-lieferadressen.md)
- [VOUCHER- (Voucher)](https://dokumentation.websale.de/en/v8s/referenz/tags/voucher-gutschein.md)
- [CSS](https://dokumentation.websale.de/en/v8s/templates/css.md)
- [Multiple addresses: tags per template](https://dokumentation.websale.de/en/v8s/referenz/tags/multiple-adressen.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.