Magento 2 include template with form in CMS BlockMagento when calling a static block's content via AJAX, images entered in CMS with are not processed into their filenameAdding a custom block to the cms home pageCustom module block - how to include sub-template?Changing catalog/product_list Block TemplateChange the Tracking Information Shipment # to Order #How do I enable Template Path and Block Name hintsBlock Template not LoadingMagento2: Contact us CMS block not showing upMagento 2 - controller block not displaying templateCall CMS Block with Category name as Identifier

What clothes would flying-people wear?

Piece of chess engine, which accomplishes move generation

Rampant sharing of authorship among colleagues in the name of "collaboration". Is not taking part in it a death knell for a future in academia?

Desktop app status bar: Notification vs error message

Is there an antonym(a complementary antonym) for "spicy" or "hot" regarding food (I DO NOT mean "seasoned" but "hot")?

Unknown indication below upper stave

How well would the Moon protect the Earth from an Asteroid?

How do I find the FamilyGUID of an exsting database

Why is it "on the inside" and not "in the inside"?

Is The Venice Syndrome documentary cover photo real?

Assuring luggage isn't lost with short layover

How to efficiently shred a lot of cabbage?

What language is Raven using for her attack in the new 52?

Can a US President, after impeachment and removal, be re-elected or re-appointed?

Foucault pendulum historical question

What force enables us to walk? Friction or normal reaction?

How do I make my photos have more impact?

Who said "one can be a powerful king with a very small sceptre"?

Composing fill in the blanks

Why would a personal invisible shield be necessary?

What is the German equivalent of the proverb 水清ければ魚棲まず (if the water is clear, fish won't live there)?

Would people understand me speaking German all over Europe?

A variant of the Multiple Traveling Salesman Problem

Nuclear breeder/reactor plant controlled by two A.I. makes too much power



Magento 2 include template with form in CMS Block


Magento when calling a static block's content via AJAX, images entered in CMS with are not processed into their filenameAdding a custom block to the cms home pageCustom module block - how to include sub-template?Changing catalog/product_list Block TemplateChange the Tracking Information Shipment # to Order #How do I enable Template Path and Block Name hintsBlock Template not LoadingMagento2: Contact us CMS block not showing upMagento 2 - controller block not displaying templateCall CMS Block with Category name as Identifier






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















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="ExperiusDonationProductBlockDonationListProduct" 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!










share|improve this question


























  • Can you include examples?

    – Dominic Xigen
    Jul 20 at 0:17











  • What kind of example?

    – Oscar Vazquez
    Jul 20 at 16:01











  • The js and some markup

    – Dominic Xigen
    Jul 20 at 17:33

















0















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="ExperiusDonationProductBlockDonationListProduct" 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!










share|improve this question


























  • Can you include examples?

    – Dominic Xigen
    Jul 20 at 0:17











  • What kind of example?

    – Oscar Vazquez
    Jul 20 at 16:01











  • The js and some markup

    – Dominic Xigen
    Jul 20 at 17:33













0












0








0








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="ExperiusDonationProductBlockDonationListProduct" 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!










share|improve this 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="ExperiusDonationProductBlockDonationListProduct" 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!







magento2 template cms-block






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 20 at 5:06









Navin Bhudiya

9401 gold badge12 silver badges27 bronze badges




9401 gold badge12 silver badges27 bronze badges










asked Jul 19 at 22:13









Oscar VazquezOscar Vazquez

298 bronze badges




298 bronze badges















  • Can you include examples?

    – Dominic Xigen
    Jul 20 at 0:17











  • What kind of example?

    – Oscar Vazquez
    Jul 20 at 16:01











  • The js and some markup

    – Dominic Xigen
    Jul 20 at 17:33

















  • Can you include examples?

    – Dominic Xigen
    Jul 20 at 0:17











  • What kind of example?

    – Oscar Vazquez
    Jul 20 at 16:01











  • The js and some markup

    – Dominic Xigen
    Jul 20 at 17:33
















Can you include examples?

– Dominic Xigen
Jul 20 at 0:17





Can you include examples?

– Dominic Xigen
Jul 20 at 0:17













What kind of example?

– Oscar Vazquez
Jul 20 at 16:01





What kind of example?

– Oscar Vazquez
Jul 20 at 16:01













The js and some markup

– Dominic Xigen
Jul 20 at 17:33





The js and some markup

– Dominic Xigen
Jul 20 at 17:33










1 Answer
1






active

oldest

votes


















1














As i see a problem with cms block associated with the method ExperiusDonationProductBlockDonationListProduct::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());





share|improve this answer

























  • Hello, can you explain where should I put that code line?

    – Oscar Vazquez
    Jul 20 at 19:39











  • It works now, but in the checkout now it sends me this message : "success":"You added Donation to your shopping cart." and does not redirects to checkout, the thing is that this module uses the same template for different areas. The same template is in Checkout, Home page and side bar of product catalog page. Do you know if it would work if I create a separated template for the checkout? Greetings!

    – Oscar Vazquez
    Jul 20 at 19:51











  • As i see in the code there are only methods that overload the page (only the one on which they are now) after adding to the product in the basket, to add a redirect from all the places you need to make changes to the code. 1. in method ExperiusDonationProductBlockDonationListProduct::getProductCollection need add this code $this->setAjaxRefreshOnSuccess(true);

    – Dmitry Makuh
    Jul 21 at 5:51












  • Also need will add correct (correct it mean what you need) redirect to method /Experius/DonationProduct/view/frontend/web/js/view/donation.js::InitAjaxCart after success function. for example window.location.replace(url.build('checkout/)); instead location.reload(); on donation.js

    – Dmitry Makuh
    Jul 21 at 6:05











  • And change my preview fix return str_replace('\', '-', parent::getNameInLayout()); to return str_replace(['\', '.'], '-', parent::getNameInLayout())

    – Dmitry Makuh
    Jul 21 at 6:07













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282697%2fmagento-2-include-template-with-form-in-cms-block%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














As i see a problem with cms block associated with the method ExperiusDonationProductBlockDonationListProduct::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());





share|improve this answer

























  • Hello, can you explain where should I put that code line?

    – Oscar Vazquez
    Jul 20 at 19:39











  • It works now, but in the checkout now it sends me this message : "success":"You added Donation to your shopping cart." and does not redirects to checkout, the thing is that this module uses the same template for different areas. The same template is in Checkout, Home page and side bar of product catalog page. Do you know if it would work if I create a separated template for the checkout? Greetings!

    – Oscar Vazquez
    Jul 20 at 19:51











  • As i see in the code there are only methods that overload the page (only the one on which they are now) after adding to the product in the basket, to add a redirect from all the places you need to make changes to the code. 1. in method ExperiusDonationProductBlockDonationListProduct::getProductCollection need add this code $this->setAjaxRefreshOnSuccess(true);

    – Dmitry Makuh
    Jul 21 at 5:51












  • Also need will add correct (correct it mean what you need) redirect to method /Experius/DonationProduct/view/frontend/web/js/view/donation.js::InitAjaxCart after success function. for example window.location.replace(url.build('checkout/)); instead location.reload(); on donation.js

    – Dmitry Makuh
    Jul 21 at 6:05











  • And change my preview fix return str_replace('\', '-', parent::getNameInLayout()); to return str_replace(['\', '.'], '-', parent::getNameInLayout())

    – Dmitry Makuh
    Jul 21 at 6:07















1














As i see a problem with cms block associated with the method ExperiusDonationProductBlockDonationListProduct::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());





share|improve this answer

























  • Hello, can you explain where should I put that code line?

    – Oscar Vazquez
    Jul 20 at 19:39











  • It works now, but in the checkout now it sends me this message : "success":"You added Donation to your shopping cart." and does not redirects to checkout, the thing is that this module uses the same template for different areas. The same template is in Checkout, Home page and side bar of product catalog page. Do you know if it would work if I create a separated template for the checkout? Greetings!

    – Oscar Vazquez
    Jul 20 at 19:51











  • As i see in the code there are only methods that overload the page (only the one on which they are now) after adding to the product in the basket, to add a redirect from all the places you need to make changes to the code. 1. in method ExperiusDonationProductBlockDonationListProduct::getProductCollection need add this code $this->setAjaxRefreshOnSuccess(true);

    – Dmitry Makuh
    Jul 21 at 5:51












  • Also need will add correct (correct it mean what you need) redirect to method /Experius/DonationProduct/view/frontend/web/js/view/donation.js::InitAjaxCart after success function. for example window.location.replace(url.build('checkout/)); instead location.reload(); on donation.js

    – Dmitry Makuh
    Jul 21 at 6:05











  • And change my preview fix return str_replace('\', '-', parent::getNameInLayout()); to return str_replace(['\', '.'], '-', parent::getNameInLayout())

    – Dmitry Makuh
    Jul 21 at 6:07













1












1








1







As i see a problem with cms block associated with the method ExperiusDonationProductBlockDonationListProduct::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());





share|improve this answer













As i see a problem with cms block associated with the method ExperiusDonationProductBlockDonationListProduct::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());






share|improve this answer












share|improve this answer



share|improve this answer










answered Jul 20 at 17:27









Dmitry MakuhDmitry Makuh

463 bronze badges




463 bronze badges















  • Hello, can you explain where should I put that code line?

    – Oscar Vazquez
    Jul 20 at 19:39











  • It works now, but in the checkout now it sends me this message : "success":"You added Donation to your shopping cart." and does not redirects to checkout, the thing is that this module uses the same template for different areas. The same template is in Checkout, Home page and side bar of product catalog page. Do you know if it would work if I create a separated template for the checkout? Greetings!

    – Oscar Vazquez
    Jul 20 at 19:51











  • As i see in the code there are only methods that overload the page (only the one on which they are now) after adding to the product in the basket, to add a redirect from all the places you need to make changes to the code. 1. in method ExperiusDonationProductBlockDonationListProduct::getProductCollection need add this code $this->setAjaxRefreshOnSuccess(true);

    – Dmitry Makuh
    Jul 21 at 5:51












  • Also need will add correct (correct it mean what you need) redirect to method /Experius/DonationProduct/view/frontend/web/js/view/donation.js::InitAjaxCart after success function. for example window.location.replace(url.build('checkout/)); instead location.reload(); on donation.js

    – Dmitry Makuh
    Jul 21 at 6:05











  • And change my preview fix return str_replace('\', '-', parent::getNameInLayout()); to return str_replace(['\', '.'], '-', parent::getNameInLayout())

    – Dmitry Makuh
    Jul 21 at 6:07

















  • Hello, can you explain where should I put that code line?

    – Oscar Vazquez
    Jul 20 at 19:39











  • It works now, but in the checkout now it sends me this message : "success":"You added Donation to your shopping cart." and does not redirects to checkout, the thing is that this module uses the same template for different areas. The same template is in Checkout, Home page and side bar of product catalog page. Do you know if it would work if I create a separated template for the checkout? Greetings!

    – Oscar Vazquez
    Jul 20 at 19:51











  • As i see in the code there are only methods that overload the page (only the one on which they are now) after adding to the product in the basket, to add a redirect from all the places you need to make changes to the code. 1. in method ExperiusDonationProductBlockDonationListProduct::getProductCollection need add this code $this->setAjaxRefreshOnSuccess(true);

    – Dmitry Makuh
    Jul 21 at 5:51












  • Also need will add correct (correct it mean what you need) redirect to method /Experius/DonationProduct/view/frontend/web/js/view/donation.js::InitAjaxCart after success function. for example window.location.replace(url.build('checkout/)); instead location.reload(); on donation.js

    – Dmitry Makuh
    Jul 21 at 6:05











  • And change my preview fix return str_replace('\', '-', parent::getNameInLayout()); to return str_replace(['\', '.'], '-', parent::getNameInLayout())

    – Dmitry Makuh
    Jul 21 at 6:07
















Hello, can you explain where should I put that code line?

– Oscar Vazquez
Jul 20 at 19:39





Hello, can you explain where should I put that code line?

– Oscar Vazquez
Jul 20 at 19:39













It works now, but in the checkout now it sends me this message : "success":"You added Donation to your shopping cart." and does not redirects to checkout, the thing is that this module uses the same template for different areas. The same template is in Checkout, Home page and side bar of product catalog page. Do you know if it would work if I create a separated template for the checkout? Greetings!

– Oscar Vazquez
Jul 20 at 19:51





It works now, but in the checkout now it sends me this message : "success":"You added Donation to your shopping cart." and does not redirects to checkout, the thing is that this module uses the same template for different areas. The same template is in Checkout, Home page and side bar of product catalog page. Do you know if it would work if I create a separated template for the checkout? Greetings!

– Oscar Vazquez
Jul 20 at 19:51













As i see in the code there are only methods that overload the page (only the one on which they are now) after adding to the product in the basket, to add a redirect from all the places you need to make changes to the code. 1. in method ExperiusDonationProductBlockDonationListProduct::getProductCollection need add this code $this->setAjaxRefreshOnSuccess(true);

– Dmitry Makuh
Jul 21 at 5:51






As i see in the code there are only methods that overload the page (only the one on which they are now) after adding to the product in the basket, to add a redirect from all the places you need to make changes to the code. 1. in method ExperiusDonationProductBlockDonationListProduct::getProductCollection need add this code $this->setAjaxRefreshOnSuccess(true);

– Dmitry Makuh
Jul 21 at 5:51














Also need will add correct (correct it mean what you need) redirect to method /Experius/DonationProduct/view/frontend/web/js/view/donation.js::InitAjaxCart after success function. for example window.location.replace(url.build('checkout/)); instead location.reload(); on donation.js

– Dmitry Makuh
Jul 21 at 6:05





Also need will add correct (correct it mean what you need) redirect to method /Experius/DonationProduct/view/frontend/web/js/view/donation.js::InitAjaxCart after success function. for example window.location.replace(url.build('checkout/)); instead location.reload(); on donation.js

– Dmitry Makuh
Jul 21 at 6:05













And change my preview fix return str_replace('\', '-', parent::getNameInLayout()); to return str_replace(['\', '.'], '-', parent::getNameInLayout())

– Dmitry Makuh
Jul 21 at 6:07





And change my preview fix return str_replace('\', '-', parent::getNameInLayout()); to return str_replace(['\', '.'], '-', parent::getNameInLayout())

– Dmitry Makuh
Jul 21 at 6:07

















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f282697%2fmagento-2-include-template-with-form-in-cms-block%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림