Commerce meta renderings

Current version: 9.1

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 Storefront template.

Meta renderings are available in the Toolbox when you edit a meta partial design. This topic describes the renderings accessible from the Commerce Experience Accelerator section in the Toolbox.

In the Experience Editor, the Commerce Metadata partial design looks like the following:

Metadata in the partial designs.

The Antiforgery meta rendering

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

Important

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.

On the live storefront, the Antiforgery rendering for the home page would appear as follows in the HTML source:

Antiforgery rendering in the HTML source on the live storefront

The Metadata meta rendering

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

On the live storefront, the Metadata meta rendering for the audio category page appears as follows in the HTML source:

Metadata meta rendering on the live storefront site

The Site Bindings meta rendering

You use the Site Bindings meta rendering to manage site binding attributes and related configurations using the SXA site management features.

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.

On the live storefront, the Site Bindings meta rendering for a page in the Storefront appears as follows:

Site Bindings meta rendering on the live storefront live.

Do you have some feedback for us?

If you have suggestions for improving this article,