Loading
Get Started with B2C Commerce
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Site Integration Meta Tag Rules for B2C Commerce

          Site Integration Meta Tag Rules for B2C Commerce

          Use these APIs to obtain page meta tags that are generated based on rules. This topic applies to B2C Commerce.

          • dw.catalog.Product for product detail page
          • dw.catalog.ProductSearchModel for product list page
          • dw.content.Content for content detail page
          • dw.content.ContentSearchModel for content list page

          You can then add them into your dw.web.PageMetaData container to have them available in your header generation, as shown in this example:

          updatePageMetaTags: function (object)
           {
             if ( object.class === dw.content.Content
                 || object.class === dw.system.Site
                 || object.class === dw.catalog.Product
                 || object.class === dw.catalog.ProductSearchModel
                 || object.class === dw.content.ContentSearchModel)
             {
                 var pageMetaData = request.pageMetaData;
                 pageMetaData.addPageMetaTags(object.pageMetaTags);
             }
           },

          The dw.web.PageMetaData container supports a loop approach, creating all your page meta tags in an easy way:

           <iscomment>Rule based page meta tags</iscomment>
           <isloop items="${pdict.CurrentPageMetaData.getPageMetaTags()}" var="pageMetaTag">
               <isif condition="${pageMetaTag.title}">
                   <title><isprint value="${pageMetaTag.content}"/></title>
               <iselseif condition="${pageMetaTag.name}">
                   <meta name="<isprint value="${pageMetaTag.ID}">" content="<isprint value="${pageMetaTag.content}">">
               <iselseif condition="${pageMetaTag.property}">
                   <meta property="<isprint value="${pageMetaTag.ID}">" content="<isprint value="${pageMetaTag.content}">">
               </isif>
           </isloop>

          The following methods enable you to check if page meta tags are generated and perform fallback behavior:

           <isif condition="${!pdict.CurrentPageMetaData.isPageMetaTagSet('description')}">
               <meta name="description" content="Add here your fallback description!">
           </isif>
           
          Loading
          Salesforce Help | Article