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

# Template migration

> Guide for moving V8 templates to the new template engine: typical V8 functions, tags and patterns mapped to the modules of the new shop version.

The template engine of this version differs fundamentally from the previous implementation in WEBSALE V8s. This page is intended to support agencies, template managers, and developers with the switch by contrasting typical functions and patterns from V8 with the corresponding concepts of this version.

The goal is to find your way around the new structure faster and to migrate existing implementations in a targeted manner instead of "reinventing" every spot.

***

## Address

* Customer account information is loaded via the [\$wsAccount](/en/frontend/referenz/module/wsAccount) module
* Address information within the order process is additionally loaded via the [\$wsCheckout](/en/frontend/referenz/module/wscheckout) module, for example the selected shipping address, selected billing address, etc.

## Basics

* Comparison of single tag, loop, range tag, negative range tag compared to V8:
  * `~Einzeltag~` → (add VX counterpart)
  * `{@Tag}` → `foreach`
  * `{Positive range} … {/Positive range}`
  * `{!Negative range} … {/!Negative range}`

## Basket

* The basket is loaded via the [\$wsBasket](/en/frontend/referenz/module/wsbasket) module

## Breadcrumb

* The breadcrumb is loaded via the [\$wsNavigation](/en/frontend/referenz/module/wsnavigation) module

## Category

* Categories, and therefore navigation, are loaded via the [\$wsCategories](/en/frontend/referenz/module/wscategories) module

## DesignControl tags

* The functions of the DesignControl tags are available via the [functions](/en/frontend/referenz/funktionen) and [modifiers](/en/frontend/referenz/modifiers)

## Encoding

* Character set changed from `iso 8859-1` to `utf-8`.
* `iso XXXX-X` is no longer supported / has been completely removed.

## Forms

* Shop actions, such as saving the billing address, login, etc., continue to be implemented via forms `<form>`. For this purpose, the new version provides [actions](/en/frontend/referenz/aktionen).
* Instead of form tags that were passed to the `<form>` in the element `action=""`, the desired template is now passed using `{{= $wsViews.current.url() }}` or `{{= $wsViews.viewUrl('login.htm')}}`, for example
  * `<form action="~FORM-Basket~" method="post">`
    * now
  * `<form action="{{= $wsViews.current.url() }}" method="post">`
    * or
  * `<form action="{{= $wsViews.viewUrl('basekt.htm')}}" method="post">`

## HTML comment

* Instead of `WS-TplComment`, the following is now used: `{{ # Your comment # }}`

## Inventory

* Stock information is loaded via the [\$wsInventory](/en/frontend/referenz/module/wsinventory) module
* Before stock information is displayed, it must be loaded, for example with\
  `{{ var $myVariableForInventoryInfo = $wsInventory.load($product.id) }}`
* `PR-Inventory` is now built with `{{ if $myVariableForInventoryInfo.active }}`
* `PR-InventoryState()` is now mapped via:
  * `{{= $myVariableForInventoryInfo.state }}` and
  * `{{ switch $myVariableForInventoryInfo.state }}` with the respective `{{ case "xxx"}}` blocks

## Links

* All page links are implemented via the [\$wsViews](/en/frontend/referenz/module/wsviews) module, for example
  * `URL-Homepage` -> `{{= $wsViews.host }}`
  * `WS-LoadTpl(your-template.htm)` ->`{{= $wsViews.viewUrl('your-template.htm')}}`
  * `WS-SSLLoadTpl()` → `{{= $wsViews.viewUrl('your-template.htm')}}`
* This also includes links such as to the basket page, wish list, login, etc., for which there were dedicated link tags in V8s, for example
  * `WS-BasketLink` → `{{= $wsViews.viewUrl('basket.htm')}}`
  * `WS-MemoListLink` → `{{= $wsViews.viewUrl('memolist.htm')}}`
  * `WS-LoginLink` → `{{= $wsViews.viewUrl('login.htm')}}`
  * `WS-LogoutLink` → `{{= $wsViews.viewUrl('logout.htm')}}`
  * `WS-UserAccountLink` -> `{{= $wsViews.viewUrl('account.htm')}}`

## Login

* Customer account information is loaded via the [\$wsAccount](/en/frontend/referenz/module/wsAccount) module
* `WS-LoginLink` is now implemented with `{{= $wsViews.viewUrl('your-file.htm')}}`
* `ST-LoggedIn` is now checked with `{{ if $wsAccount.isLoggedIn }}`

## Logout

* Customer account information is loaded via the [\$wsAccount](/en/frontend/referenz/module/wsAccount) module
* `WS-LogoutLink` is now implemented with `{{= $wsActions.url('Logout', $wsViews.viewUrl('logout.htm'), {})}}`

## Memolist

* The wish list is loaded via the [\$wsWatchList](/en/frontend/referenz/module/wswatchlist) module
* `ST-MemoList_OK` is now checked with `{{ if $wsWatchList.items }} ... {{ /if }}`
* `WS-MemoListEntries` is now displayed with `{{= $wsWatchList.items | len }}`

## Meta tags

* `<base href="...">` is no longer needed
* The function `{{=static('')}}` contains the base directory information.
* `WS-RobotCanonical` is now built with `{{= $wsViews.host }}` and `{{= $wsViews.current.url() }}`

## Payments

* Overview of all configured payment methods
  * instead of `TAC-P-Data` now `{{ foreach $myVariableForAllPayments in $wsConfig.payments }}`
* Payment methods within the order process are additionally loaded via the [\$wsCheckout](/en/frontend/referenz/module/wscheckout) module, for example the selected payment method

## Products

* Product information is loaded via the [\$wsProducts](/en/frontend/referenz/module/wsproducts) module

## Search

* Implementation of all search and filter functions takes place via the search module [WEBSALE Search](https://websale.atlassian.net/wiki/spaces/Doku/pages/2913992717/WEBSALE+search)

## ShippingMethod

* Instead of "deliverer" and "delivery", we now use "shipping" and "shippingMethods"
* Overview of all configured shipping methods
  * instead of `TAC-D-Data` now `{{ foreach $yVariableForAllShippings in $wsConfig.shippingMethods }}`
* Shipping information within the order process is additionally loaded via the [\$wsCheckout](/en/frontend/referenz/module/wscheckout) module, for example the selected shipping method

## User account

* Customer account information is loaded via the [\$wsAccount](/en/frontend/referenz/module/wsAccount) module
* `WS-UserAccountLink` -> `{{= $wsViews.viewUrl('account.htm')}}`
