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;
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
add a comment |
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
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
add a comment |
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
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
magento2 template cms-block
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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());
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
|
show 3 more comments
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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());
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
|
show 3 more comments
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());
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
|
show 3 more comments
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());
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());
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
|
show 3 more comments
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
|
show 3 more comments
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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