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

# TopRank HTML pages

> The placeholders of the two TopRank templates: generate static HTML pages for search engines from categories and products, with category data, product loop, deep links and paging links.

TopRank generates static HTML pages from a shop's product range, one per category, plus an overview page per subshop. These pages exist as real files on the server and are therefore also reachable for search engines that cannot do anything with a shop system. From there, deep links lead into the shop.

Two templates determine what these pages look like. During generation, the shop system replaces placeholders in them with the data of the respective category. This page describes all placeholders and states in which of the two templates and where within it they may be placed.

Guide: Customising templates for TopRank

> [!WARNING]
>
> The placeholders on this page are **not shop template tags**. They are not evaluated by the shop system when a page is called, but replaced once when the TopRank pages are generated. Conversely, not a single `PR-`, `CAT-` or `WS-` tag works in these templates.

## The two templates

| Template | Generates |
| - | - |
| `template-category.htm` | one page per category |
| `template-subshop.htm` | the overview page of a subshop |

> [!NOTE]
>
> Both files are in the shop's TopRank directory. The shop system first looks for a subshop-specific version with the subshop identifier appended, for example `template-category-deutsch.htm`. Only if it does not find one does it use the general file. This lets you design individual subshops separately without touching the others.

> [!WARNING]
>
> If either of the two templates is missing, generation aborts. Always create both, even if you hardly want to design the overview page.

> [!NOTE]
>
> Placeholders are written as in the shop template, that is, `~Name~` for a value, `{Name}` and `{/Name}` for an area and `{@Name}` and `{/@Name}` for a loop.

> [!WARNING]
>
> Placeholders that have not been replaced are removed from the finished page at the end. A typo in the name therefore goes unnoticed; the spot simply remains empty. After changing the template, always check a generated page.

## Shop details

These placeholders are freely available in both templates.

| Placeholder | Returns |
| - | - |
| `Shopname` | the shop name stored in the TopRank configuration |
| `ShopID` | the shop identifier |
| `SubshopID` | the subshop identifier |
| `ShopKeyword` | the keyword for the shop stored in the TopRank configuration |
| `HomeUrl` | the link to the shop's start page |
| `StartUrl` | the link to the TopRank overview page of this subshop |
| `URL-Template` | the base address of the shop |
| `Year` | the current year |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<p>&copy; ~Year~ ~Shopname~ | <a href="~HomeUrl~">zum Shop</a></p>
```

> [!NOTE]
>
> `StartUrl` and `URL-Template` exist in the shop system but are not described in the previous documentation. `StartUrl` is the more useful of the two, because it lets you build the way back to the TopRank overview on every category page.

> [!WARNING]
>
> Do not confuse `HomeUrl` and `StartUrl`. `HomeUrl` leads into the shop, `StartUrl` to the static overview page. Both have their place, but they mean different things.

> [!NOTE]
>
> `ShopID` and `SubshopID` are suitable for tracking scripts that should also run on the static pages.

## The category page

Everything in this section applies exclusively in `template-category.htm`.

### The displayed category

| Placeholder | Returns |
| - | - |
| `Catname` | the name of the category |
| `Catname-1` | the name of the parent category |
| `CatPage` | the file name of this page |
| `CatPage-1` | the file name of the parent category |
| `CatDescr` | the description of the category |
| `CatDescr()` | the same description, shortened to the specified length |
| `CatShortDescr` | the description shortened to a fixed length |
| `Keywords` | a list of keywords |
| `Cat-FreeField1` to `Cat-FreeField5` | the free TopRank fields of the category |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<h1>~Catname~</h1>
{Catname-1}<p><a href="~CatPage-1~">zurück zu ~Catname-1~</a></p>{/Catname-1}
<meta name="keywords" content="~Keywords~">
<meta name="description" content="~CatDescr(160)~">
```

> [!WARNING]
>
> The description is called `CatDescr`, not `Cat-Descr`. At this point, the previous documentation writes a hyphen that the shop system does not recognise, which also contradicts its own `SCatDescr` for subcategories. A template with `~Cat-Descr~` produces an empty spot.

> [!NOTE]
>
> `CatDescr()` shortens to the number of characters specified in parentheses and removes all HTML markup in the process. This is intentional, because otherwise cutting off in the middle of the text would leave an open element without its closing counterpart. This is the right version for the `description` entry in the page header.

> [!NOTE]
>
> `CatPage`, `CatPage-1` and `CatShortDescr` exist in the shop system but are not described in the previous documentation. `CatPage-1` is the missing half of `Catname-1`, because without the file name you cannot build a link from the name of the parent category.

> [!NOTE]
>
> `Keywords` is generated by the shop system and contains the name of the category as well as the names of up to three parent categories. If there are fewer, the shop system fills up with fixed terms. The word from `ShopKeyword` is always included.

> [!NOTE]
>
> The five free fields per category are maintained in the TopRank Manager and hold up to 4000 characters. They can be used as a value and as an area; the area applies if the field is filled.

### The products of the category

`{Products}` is the area that only appears if the category contains products. `{@Products}` is the loop over them.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{Products}
   <h2>Artikel in dieser Kategorie</h2>
   {@Products}
      <div class="artikel">
         <img src="~Thumbnail~" alt="~PrdName~">
         {RobotProdIndex}
            <h3><a href="~Shopurlprd~">~PrdName~</a></h3>
         {/RobotProdIndex}
         {!RobotProdIndex}
            <h3>~PrdName~</h3>
         {/!RobotProdIndex}
         <p>~PrdShortDescr~</p>
      </div>
   {/@Products}
{/Products}

{!Products}
   <p>In dieser Kategorie sind derzeit keine Artikel hinterlegt.</p>
{/!Products}
```

| Placeholder | Returns |
| - | - |
| `PrdName` | the name of the product |
| `PrdShortDescr` | the short description |
| `PrdDescr` | the full description |
| `Thumbnail` | the address of the preview image |
| `Image` | the address of the normal-sized product image |
| `Shopurlprd` | the deep link to the product in the shop |
| `{RobotProdIndex}` | area: the products of this category may be indexed |

> [!WARNING]
>
> All product placeholders are placed exclusively **within** the `{@Products}` loop. This also applies to `{RobotProdIndex}`, even though the previous documentation lists it separately from the loop. Outside, it has no effect.

> [!NOTE]
>
> `PrdDescr` exists in the shop system but is not described in the previous documentation. It returns the full description of the product including HTML markup.

> [!NOTE]
>
> `PrdShortDescr` uses the maintained short description. If it is missing, the shop system instead shortens the full description to about 150 characters. The spot therefore only remains empty if both fields are empty.

> [!WARNING]
>
> If the TopRank Manager is set so that the products of a category should not be indexed, `{RobotProdIndex}` does not apply **and** `Shopurlprd` remains empty. Therefore, always bracket the deep link, otherwise you get a link that leads nowhere.

> [!NOTE]
>
> Not every product in the category ends up on the page. Products that are not visible at the time of generation and products of the autobasket category are skipped. The previous documentation does not mention this.

### Paging with many products

The number of products per page is limited in the TopRank configuration. If a category has more, the shop system distributes them across several files.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{Splitlinks}
   <nav class="blaettern">~Splitlinks~</nav>
{/Splitlinks}
```

> [!WARNING]
>
> `Splitlinks` does not return the individual links but a ready-made HTML block with forward and back arrows and the page numbers. The markup in it is predefined by the shop system and contains no CSS classes. It can only be styled via a surrounding element. The previous documentation does not make clear that ready-made HTML is returned here.

> [!NOTE]
>
> If the category fits on one page, `Splitlinks` remains empty. Therefore, place the paging navigation in a bracketing, otherwise short pages will contain an empty element.

## The subcategories

This section applies in **both** templates. On the overview page, you use it to loop over the top-level categories; on a category page, over its subcategories.

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{Categories}
   <h2>Bereiche</h2>
   {@Categories}
      <div class="kategorie">
         <h3><a href="~SCatPage~">~SCatName~</a></h3>
         <p>~SCatDescr(200)~</p>
         {RobotIndex}
            <p><a href="~SShopurlcat~">im Shop ansehen</a></p>
         {/RobotIndex}
      </div>
   {/@Categories}
{/Categories}
```

| Placeholder | Returns |
| - | - |
| `{Categories}` | area: there are subcategories |
| `{@Categories}` | the loop over the subcategories |
| `SCatPage` | the file name of the TopRank page of this subcategory |
| `SCatName` | the name prepared for search engines |
| `SCatDescr` | the description |
| `SCatDescr()` | the same description, shortened to the specified length |
| `SShopurlcat` | the deep link to the category in the shop |
| `{RobotIndex}` | area: this subcategory may be indexed |
| `SCat-FreeField1` to `SCat-FreeField5` | the free TopRank fields of this subcategory |

> [!WARNING]
>
> `{RobotIndex}` refers to the **subcategory in the current iteration**, not to the currently displayed category, and is therefore placed within `{@Categories}`. The previous documentation lists it separately from the loop, which suggests that it could also be used at page level. This is not the case; there is no corresponding bracketing for the category itself.

> [!WARNING]
>
> If a subcategory should not be indexed, `SShopurlcat` additionally remains empty. The deep link therefore belongs inside `{RobotIndex}` in any case. The link to the TopRank page via `SCatPage` is not affected by this and continues to work.

> [!NOTE]
>
> `SCatName` is not simply the category name but the search term stored in the TopRank Manager, if one is maintained there. Only otherwise does the shop system fall back on the category name.

> [!NOTE]
>
> `SCatDescr()` shortens and removes HTML markup in the process, just like `CatDescr()` at category level.

## The overview page

Two placeholders exist only in `template-subshop.htm`.

| Placeholder | Returns |
| - | - |
| `CreateDate` | date and time of the last generation |
| `ShopDescr` | the shop description stored in the TopRank configuration |

```html theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
<p>~ShopDescr~</p>
<p class="stand">Stand: ~CreateDate~</p>
```

> [!NOTE]
>
> `ShopDescr` exists in the shop system but is not described in the previous documentation. It is the counterpart to `CatDescr` on the category page and usually belongs in the `description` entry in the page header of the overview.

> [!NOTE]
>
> `CreateDate` contains date and time in the format `TT.MM.JJJJ HH:MM:SS`. The value comes from the moment of generation, not from the page call. On a static page, this is exactly the sensible value.

## Placeholders at a glance

| Placeholder | Category template | Subshop template | Placed in |
| - | - | - | - |
| `Shopname` | yes | yes | free |
| `ShopID` | yes | yes | free |
| `SubshopID` | yes | yes | free |
| `ShopKeyword` | yes | yes | free |
| `HomeUrl` | yes | yes | free |
| `StartUrl` | yes | yes | free |
| `URL-Template` | yes | yes | free |
| `Year` | yes | yes | free |
| `Catname` | yes | – | free |
| `Catname-1` | yes | – | free |
| `CatPage` | yes | – | free |
| `CatPage-1` | yes | – | free |
| `CatDescr` | yes | – | free |
| `CatDescr()` | yes | – | free |
| `CatShortDescr` | yes | – | free |
| `Keywords` | yes | – | free |
| `Cat-FreeField1` to `5` | yes | – | free |
| `{Products}` | yes | – | free |
| `{@Products}` | yes | – | free |
| `PrdName` | yes | – | `{@Products}` |
| `PrdDescr` | yes | – | `{@Products}` |
| `PrdShortDescr` | yes | – | `{@Products}` |
| `Thumbnail` | yes | – | `{@Products}` |
| `Image` | yes | – | `{@Products}` |
| `Shopurlprd` | yes | – | `{@Products}` |
| `{RobotProdIndex}` | yes | – | `{@Products}` |
| `Splitlinks` | yes | – | free |
| `{Categories}` | yes | yes | free |
| `{@Categories}` | yes | yes | free |
| `SCatPage` | yes | yes | `{@Categories}` |
| `SCatName` | yes | yes | `{@Categories}` |
| `SCatDescr` | yes | yes | `{@Categories}` |
| `SCatDescr()` | yes | yes | `{@Categories}` |
| `SShopurlcat` | yes | yes | `{@Categories}` |
| `{RobotIndex}` | yes | yes | `{@Categories}` |
| `SCat-FreeField1` to `5` | yes | yes | `{@Categories}` |
| `CreateDate` | – | yes | free |
| `ShopDescr` | – | yes | free |

> [!NOTE]
>
> The "Placed in" column names the loop within which the placeholder must be placed. Anything marked "free" may be placed anywhere in the respective template.

## Related topics

* Guide: Customising templates for TopRank
* Guide: SEO optimisation with TopRank
* Guide: SEO URLs
* Reference: SEO- (TopRank URL settings)


## Related topics

- [SEO optimization with TopRank](https://dokumentation.websale.de/en/v8s/seo/seo-optimierung-mit-toprank.md)
- [Basics and technology](https://dokumentation.websale.de/en/v8s/referenz/konfigurationen/shopkonfiguration-shop-config/grundlagen-und-technik.md)
- [SEO- (URL settings TopRank)](https://dokumentation.websale.de/en/v8s/referenz/tags/seo-url-einstellungen-toprank.md)
- [SEO URLs and link optimization](https://dokumentation.websale.de/en/v8s/seo/seo-urls-und-link-optimierung.md)
- [General online services](https://dokumentation.websale.de/en/v8s/online-servicebereich/allgemeine-online-dienste.md)


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