1

I've one third party extension which is adding addthis block on few pages.

I want to add addthis block on product page too.

<page layout="1column" xmlns:xsi="w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="urn:magento:framework:View/La‌​yout/etc/page_config‌​uration.xsd"> 
   <body> 
          <referenceContainer name="content"> <block class="Magefan\Blog\Block\Social\AddThis" name="addthis.js.init.new" template="Magefan_Blog::addthis-js.phtml" after="product.info.details" /> </referenceContainer> 
     </body> 
</page>

So I'm thinking to use the same block from that third party module. I've added that block definition in catalog_product_view.xml file in my custom module. But its not working. Can anyone help me please?

  • Please add catalog_product_view.xml which you have added for it. – Suresh Chikani Nov 21 '16 at 13:33
  • <page layout="1column" xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magefan\Blog\Block\Social\AddThis" name="addthis.js.init.new" template="Magefan_Blog::addthis-js.phtml" after="product.info.details" /> </referenceContainer> </body> </page> – Deeps Nov 21 '16 at 13:34
  • Do not add it in comment, add it in your question. – Suresh Chikani Nov 21 '16 at 13:35
  • Ok. Any fix on this? – Deeps Nov 21 '16 at 13:50
1

Remove unwanted character ; from <page .. tag,

<page xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/La‌​yout/etc/page_config‌​uration.xsd"> 
   <body> 
      <referenceContainer name="content">
          <block class="Magefan\Blog\Block\Social\AddThis" name="addthis.js.init.new" template="Magefan_Blog::addthis-js.phtml" after="product.info.details" />
      </referenceContainer> 
    </body> 
</page>

try this

  • Hey, that might be added by mistake. There is no semicolon in my code. – Deeps Nov 21 '16 at 13:51
  • check this xmlns:xsi="w3.org/2001/XMLSchema-instance"; also remove layout="1column" – chirag Nov 21 '16 at 13:52
  • Ok. I've removed that but still not working. – Deeps Nov 21 '16 at 14:14
  • check phtml file path in your custom extension. – chirag Nov 21 '16 at 14:15
  • Anyways, I've created my own block for that. Thank you for your answers. – Deeps Nov 21 '16 at 14:44

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.