0

I need to have a different Facebook OG:IMAGE for each CMS PAGE.

I found on official documentation how to add a custom layout update on Magento 2.3.4 --> I've already created this file cms_page_view_selectable_faq_test1.xml (where "faq" is the cms page URL key, and "test1" is the name of the override) inside mythemeoverride/Magento_Theme/layout/

The file contains this code:

<?xml version="1.0"?>

<page>
    <head>
        <meta property="og:image" content="https://dev.push96.com/media/wysiwyg/push/push96-300x300.png" />
    </head>
</page>

I have chosen the override "test1" inside the custom layout update XML of "faq" page, but the result is:

*Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'meta', attribute 'property': The attribute 'property' is not allowed.
Line: 1315*

Any idea what's wrong?

| improve this question | | | | |
0

I found the solution myself, thanks to this link found on google: https://olegnax.com/documentation/magento-2/how-to-add-custom-layout-update-in-magento-2-3-4/

The correct syntax is:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  <head>
    <meta property="og:image" content="https://dev.push96.com/media/wysiwyg/push/push96-300x300.png" />
  </head>
</page>
| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.