Question

I have been struggling trying to put a template functionally working inside a CMS Block. When I put this code inside my CMS block the template is correctly implemented

{{block class="Experius\DonationProduct\Block\Donation\ListProduct" name="cms.donation.list" template="Experius_DonationProduct::donation.phtml"}}

However, the template has a pop up window that comes up when you click a button, and that pop up has a form. The problem is that the pop-up window does not come up when it's in the CMS block, it's like if JS functions were not working.

The template is located in app/design/frontend/Vendor/Theme/Experius_DonationProduct/templates/donation.phtml its override from the original module. What can I do? Thank you and greetings!

Was it helpful?

Solution

As i see a problem with cms block associated with the method \Experius\DonationProduct\Block\Donation\ListProduct::getIdentifier. The problem is that when we get the block name in cms, we get a name that contains an element "\" that can not be properly processed. Please try change method getIdentifier for that

return str_replace('\\', '-', parent::getNameInLayout());
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top