Commerce meta renderings

Current version: 9.0

The SXA storefront pages contain meta renderings, which add metadata to the pages. The renderings are included in the meta partial designs that are used on every page in the SXA Storefront template.

Meta renderings are available in the SXA toolbox when you edit a meta partial design. In the Experience Editor, the Commerce Metadata partial design looks like the following:

This topic describes:

The Antiforgery meta rendering

You can use the Antiforgery meta rendering to insert the <form> tag with the antiforgery token into a partial design. The antiforgery token is passed to every JavaScript API call that the Commerce renderings make. This prevents cross-site request attacks from being made on the website.

Note

The Commerce renderings are dependent on the Antiforgery meta rendering. You must include the Antiforgery meta rendering on all storefront pages to ensure that the Commerce renderings behave as expected.

In the SXA Storefront template, the Antiforgery meta rendering is included in the <body> of the Commerce Metadata partial design so that it generates the antiforgery token HTML that is required by the site.

Appearance on the live storefront

The following shows the Antiforgery rendering in the HTML source for the home page:

The Metadata meta rendering

You can use the Metadata meta rendering to inject canonical URLs in order to improve the search engine indexing of categories and products.

Appearance on the live storefront

The following shows the Metadata meta rendering in the HTML source for the audio category page:

The Site Bindings meta rendering

SXA provides site management features that enable you to manage site binding attributes and other related configuration.

After the Site Bindings rendering is added to a page, the metadata information about the site's current bindings is rendered in the HTML output as hidden fields. Client-side scripts can access those hidden fields. The Site Bindings rendering inserts the following fields in the HTML source:

  • SiteVirtualFolder – the current site's virtual folder.

  • SiteRootPath – the current site's root item path.

  • SiteStartPath – the start item for the current site.

  • SiteContentStartPath – the content start item for the current site.

Appearance on the live storefront

The following shows the Site Bindings meta rendering in the HTML source for a page in the SXA Storefront:

Do you have some feedback for us?

If you have suggestions for improving this article,