When you render dynamic Product Detail or Product List pages, use Page Meta Tag Rules
that merchants configured to create meta tags in the HTML markup. Include a decorator that
creates the HTML <head>
section of the page. When rendering the page,
get the data from the Page Meta Tag Rules, and pass it to the decorator.
For example, if you are working with SFRA pages and components, you can include the following code in the implementation of your page, after all regions and all components are rendered, but before the decorator.
pdict.CurrentPageMetaData = PageRenderHelper.getPageMetaData(pdict.page);
The template htmlHead.isml
, which is included indirectly in the SFRA
decorator templates, uses pdict.CurrentPageMetaData
to create the
appropriate HTML meta tags.