Loading
Get Started with B2C Commerce
Índice de materias
Seleccionar filtros

          No hay resultados
          No hay resultados
          Estas son algunas sugerencias de búsqueda

          Compruebe la ortografía de sus palabras clave.
          Utilice términos de búsqueda más generales.
          Seleccione menos filtros para ampliar su búsqueda.

          Buscar en toda la Ayuda de Salesforce
          Meta Tag Syntax for B2C Commerce

          Meta Tag Syntax for B2C Commerce

          The rule syntax supports the following different operations that are optimized for page meta tag content generation. Also, script operators are not valid for each scope. This topic applies to B2C Commerce.

          For example, site is available for each scope, while category is available for PLP and PDP and not for CLP or CDP, as follows:

          • All scopes
            • script operators: or, and, else, if-then, equals
            • access to Site context
            • access to Host context
            • print a static Constant value
            • access to original request URL
          • List pages
            • access to search refinements
            • access to search phrase
          • Product list and detail pages
            • access to category object
          • Content list and detail pages
            • access to folder object
          • Product detail pages
            • access to product object
            • access to the product price
            • access to the product image URL
          • Content detail pages
            • access to content object

          The page meta tag rule has both static and dynamic elements. Static elements are printed directly and dynamic elements must be defined within the script syntax: ${dynamic-expression-here}. The dynamic-expression can contain operators and objects as follows.

          Static Text

          Static text is typically used with a dynamic element, such as 'Some static text with dynamic part ${expression} here.'

          If expression is empty, the content, 'Some static text with dynamic part here.' is generated.

          If expression evaluates to 'Dynamic String Value', the content, 'Some static text with dynamic part Dynamic String Value here.' generates.

          When creating rules, print specific static text if something evaluates true, such as in Constant('constant text').

          As an example:

          Static text and ${Constant('static text in rule')} here.

          Generates as:

          Static text and static text in rule here.

          Dynamic Text

          With page meta tags, dynamic text enables you to access to the Product, Category, Folder, Content, and Site objects and their values. All defined system and custom values are available, except defined passwords and unsupported values, for example:

          Product.brand
          Product.pageDescription
          ...
          Product.custom.washingInstructions
          ...

          The following script:

          Find ${Product.name} in ${Category.displayName} today | ${Site.displayName}

          Generates the content:

          Find Apple iPod Classic in iPod & MP3 Players today | SiteGenesis' for product 'apple-ipod-classic' in SiteGenesis.

          Supported Object Attributes

          Value Type Supported
          String Yes
          Text Yes
          HTML No
          Integer Yes
          Number Yes
          Boolean Yes
          Date No
          Date+Time No
          Image No
          Email Yes
          Password No
          Set of Strings Yes
          Set of Integers Yes
          Set of Numbers Yes
          Enum of Strings Yes (Only if Multiple is not marked)
          Enum of Integers Yes (Only if Multiple is not marked)

          Convenience Objects

          Some information is not directly available on the object itself or is only accessible with further effort. For this information, you can use convenience object expressions within the script.

          For the Convenience Object ProductImageURL:

          ProductImageURL.viewtype

          The following script:

          ${ProductImageURL.medium}

          Generates the content:

          https://www.site-genesis.com/on/company.static/-/Sites-electronics-catalog/default/dw32ee7837/images/medium/ipod-classic-silver.jpg'
           for product 'apple-ipod-classic' in SiteGenesis.
          Note
          Note If ProductImageURL.viewtype is used in Merchant Tools | Site | SEO & Discoverability | Page Meta Tag Rules replace viewtype with the specific value defined in Merchant Tools | Site | Products and Catalogs | Catalogs | Image Settings.

          For the Convenience Object ProductPrice:

           ProductPrice.min
           ProductPrice.max
           ProductPrice.currency

          The following script:

          ${ProductPrice.min} ${ProductPrice.currency}

          Generates the content:

          '199.00 USD' for product 'apple-ipod-classic' in SiteGenesis.

          The Convenience Object SearchRefinement supports two optional arguments: the delimiter, followed by the text into which the values are added:

           SearchRefinement.refinementID
           SearchRefinement.refinementID(',')
           SearchRefinement.refinementID(',', 'for the refinements ?') ... values are printed into the question mark placeholder

          The following script:

          ${SearchRefinement.refinementColor(' and ', 'for the color ?')}

          Generates the content '' for the search page without any selection. If the color black is selected, the content 'for the color black' generates. If blue is later selected, the content 'for the color black and blue' generates.

          The Convenience Object SearchPhrase supports one optional argument that defines the text into which the value is added:

           SearchPhrase
           SearchPhrase('for the search phrase ?')

          The following script:

          ${SearchPhrase('for the search phrase ?')}

          Generates empty content for the search page without a search phrase. If the search phrase shoes is added, the content 'for the search phrase shoes' generates.

          For the Convenience Object OriginalRequestURL:

          OriginalRequestURL

          The following script:

          ${OriginalRequestURL}

          Generates the following content if this is the request URL:

          http://www.sitegenesis.com/mens/

          The URL is printed exactly as requested.

          OR Expression

          The logical OR expression means the left or right side must evaluate true. This expression supports a one-argument constructor, defining the static text printed between the left and right side if both are available.

           leftExpression OR rightExpression
                      leftExpression OR(' delimiter ') rightExpression

          The following script:

          Find ${Product.name OR(' in ') Category.displayName} today | ${Site.displayName}

          Generates the content:

          'Find Apple iPod Classic in iPod & MP3 Players today | SiteGenesis' for product 'apple-ipod-classic

          When the category displayName is removed from the corresponding category, the following content generates:

          'Find Apple iPod Classic today | SiteGenesis'

          AND Expression

          The logical AND expression, which means the left and right side must evaluate true. This expression supports a one-argument constructor, defining the static text printed between the left and right side.

           leftExpression AND rightExpression
                      leftExpression AND(' delimiter ') rightExpression

          The following script:

          Find ${Product.name AND(' in ') Category.displayName} today | ${Site.displayName}

          Generates the content:

          'Find Apple iPod Classic in iPod & MP3 Players today | SiteGenesis' for product 'apple-ipod-classic'.

          When the category displayName is removed from the corresponding category, the following content generates:

          'Find today | SiteGenesis'

          ELSE Expression

          The logical fallback expression, which means that if the left side evaluates false, evaluate the right side.

           leftExpression ELSE rightExpression
                      expression1 ELSE expression2 ELSE
                      expression3 ELSE expression4 ... there is no limit

          The following script:

          Find ${Product.name AND(' in ') Category.displayName ELSE Product.ID AND(' in ') Category.ID} today | ${Site.displayName}

          Generates the content:

          'Find Apple iPod Classic in iPod & MP3 Players today | SiteGenesis' for product 'apple-ipod-classic'.

          When the category displayName is removed from corresponding category, then the following content generates:

          'Find apple-ipod-classic in electronics-digital-media-players today | SiteGenesis'

          IF-THEN Expression

          The logical if true, then do something else expression, which means that if the left side evaluates true, then evaluate the right side.

          IF leftExpression THEN rightExpression

          The following script:

          ${IF SearchRefinement.refinementColor OR SearchPhrase THEN Constant('noindex,nofollow') ELSE Constant('index,follow')}

          Generates the content 'index,follow' if no color is selected and no search phrase is set. If color or search phrase is set, the content 'noindex,nofollow' generates.

          ENDIF Expression

          IF-THEN-ELSE expressions now support nesting, using the ENDIF operator as a logical closing element.

          IF expression THEN IF otherExpression THEN [...] ELSE [...] ELSE [...] ENDIF ELSE [...] ENDIF

          EQ Expression

          The logical equals check expression.

          leftExpression EQ rightExpression

          The following script:

          ${IF ProductPrice.min EQ ProductPrice.max
                      THEN ProductPrice.min ELSE ProductPrice.min
                      AND('-') ProductPrice.max} ${ProductPrice.currency}

          Generates the content '199.00 USD' for product 'apple-ipod-classic'. For a product with a min price '90' and max price '120', the content '90.00-120.00 USD' generates.

          CONTAINS Operator

          The CONTAINS operator indicates a search for any of the specified words or phrases within a particular property. If no operator is specified, the CONTAINS operator is assumed

          IF SearchPhrase EQ Constant('shoes') THEN ... ELSE ... IF SearchPhrase CONTAINS Constant('shoes') THEN ... ELSE ...
           
          Cargando
          Salesforce Help | Article