Skip to main content
With the $wsViews module, you can access information about the current page and generate URLs to other shop pages. Typical use cases are SEO optimization (meta tags, hreflang), navigation, and conditional content based on the current template. In this section, you will learn how to access page data and generate SEO-friendly URLs.

Module overview

Example / excerpt of $wsViews
JSON output
Note: ƒ() denotes a function. Variables and methods overview

Variables

$wsViews.current

Contains all information about the currently displayed page.

$wsViews.current.ctrlName

Returns the name of the view controller that delivers the current page.

$wsViews.current.closedShopRedirected

Returns whether the user was redirected from a closed shop.

$wsViews.current.info

Returns context-specific data, e.g. the current product on product pages (info.product) or the category on category pages (info.category).

$wsViews.current.name

Returns the name of the current view.

$wsViews.current.paramList

Returns a list of URL parameters. Each entry contains name and value.

$wsViews.current.params

Returns the URL parameters as a map.

$wsViews.current.robotOptions

Returns the robots settings of the page.

$wsViews.current.status

Returns the HTTP status code of the page.

$wsViews.host

Returns the URL of the shop’s home page.

Methods

$wsViews.current.url()

Generates an SEO-friendly URL to a shop page. The URL is automatically generated with descriptive paths (e.g. /produkte/beispiel-produkt instead of ?productId=123). Signature
$wsViews.current.url()
Return value
string - Current URL / path.
Example that outputs the current URL.

$wsViews.url()

Builds a link to a shop page (e.g. product page, category page). The URL is automatically generated in SEO-friendly format. Signature
string $wsViews.url(viewCtrl, params)
Return value
string - URL/path to the desired page.
Parameters Example
Example that generates a URL to a product page.
Return example:

$wsViews.viewUrl()

Generates a URL to a template file. Signature string wsViews.viewUrl(path, params, type) Return value
string - URL to the specified view.
Parameters Example that generates a URL to the forgot-password page:

$wsViews.metaTitle()

Returns the page title for the browser tab and search results. Signature
string $wsViews.metaTitle()
Return value
string - Page title.
Example that sets the meta title in the HTML head:

$wsViews.metaDescription()

Returns the page description for search results. Signature
string $wsViews.metaDescription()
Return value
string - Page description.
Example that sets the meta description in the HTML head.

$wsViews.getHreflangManual()

Returns manually configured hreflang entries. Signature
$wsViews.getHreflangManual()
Return value
array - List of manual language versions.
Example that outputs manual hreflang links.

$wsViews.current.getHreflangAutomatic()

Returns the language versions of the current page for hreflang tags. Signature
$wsViews.current.getHreflangAutomatic()
Return value
array - List of language versions (lang, href).
Example that outputs automatic hreflang links.

Actions

No actions are available for $wsViews.

Examples for URL and parameter access

View URL & host

Template-conditional content output

Reading parameters (list & specific query)

Iteration over all parameters:
Specific check (example “otp”):

Hreflang & meta (short examples)