Commerce meta renderings

Abstract

Learn about the meta renderings that come with the Commerce renderings for SXA.

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:

AAE8C4C0E9F34942A7FB4B8913364B60.png

This topic describes:

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:

2CA4EBB9B6514A3CB73073501C147D25.png

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:

271F9E84EB0E4EF7BB97050B763F8AE7.png

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:

5561D799C9284EF1AE7CD5ECFE8D3B1F.png