Magento 2 - Block in footer doesn't show
I'm trying to add a block to a template built from scratch.
Using template-hints I can see that in the footer the following template is rendered
app/design/frontend/Merchant/merchant/Magento_Theme/templates/html/footer-cms.phtml
with some search I fount that the template is configured in app/design/frontend/Merchant/merchant/Magento_Theme/page_layout/1column.xml
:
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<!-- REMOVE MAGENTO HEADER & FOOTER -->
<referenceContainer name="header.container" remove="true"/>
<referenceContainer name="footer-container" remove="true"/>
<referenceContainer name="page.top" remove="true" />
<!-- INCLUDES TYPO3 HEADER & FOOTER -->
<referenceContainer name="page.wrapper">
<block class="MagentoFrameworkViewElementTemplate" name="t3header" as="t3header"
before="main.content"
template="Magento_Theme::html/header-cms.phtml"/>
<block class="MagentoFrameworkViewElementTemplate" name="t3footer" as="t3footer"
before="before.body.end"
template="Magento_Theme::html/footer-cms.phtml"/>
</referenceContainer>
</layout>
as I would like to add a newsletter subscription and terms checkbox in the footer, I am trying to do it in app/code/Myvendor/Newsletter/view/frontend/layout/1column.xml
but it doesn't show up even after clearing the cache and I can't figure out why
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<referenceContainer name="t3footer">
<block class="MagentoFrameworkViewElementTemplate" name="wf.newsletter2" as="wf.newsletter2"
before="-"
template="Myvendor_Newsletter::newsletterprivacy.phtml"/>
</referenceContainer>
</layout>
I've also tried to put it in the shop/app/code/Myvendor/Newsletter/view/frontend/layout/default.xml
<?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">
<body>
<referenceBlock name="footer_links">
<block class="MagentoFrameworkViewElementTemplate" name="wf.newsletter" as="wf.newsletter"
before="-"
template="Myvendor_Newsletter::newsletterprivacy.phtml"/>
</referenceBlock>
</body>
</page>
but nothing happened
Can someone help please?
magento2 layout blocks footer
bumped to the homepage by Community♦ 4 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'm trying to add a block to a template built from scratch.
Using template-hints I can see that in the footer the following template is rendered
app/design/frontend/Merchant/merchant/Magento_Theme/templates/html/footer-cms.phtml
with some search I fount that the template is configured in app/design/frontend/Merchant/merchant/Magento_Theme/page_layout/1column.xml
:
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<!-- REMOVE MAGENTO HEADER & FOOTER -->
<referenceContainer name="header.container" remove="true"/>
<referenceContainer name="footer-container" remove="true"/>
<referenceContainer name="page.top" remove="true" />
<!-- INCLUDES TYPO3 HEADER & FOOTER -->
<referenceContainer name="page.wrapper">
<block class="MagentoFrameworkViewElementTemplate" name="t3header" as="t3header"
before="main.content"
template="Magento_Theme::html/header-cms.phtml"/>
<block class="MagentoFrameworkViewElementTemplate" name="t3footer" as="t3footer"
before="before.body.end"
template="Magento_Theme::html/footer-cms.phtml"/>
</referenceContainer>
</layout>
as I would like to add a newsletter subscription and terms checkbox in the footer, I am trying to do it in app/code/Myvendor/Newsletter/view/frontend/layout/1column.xml
but it doesn't show up even after clearing the cache and I can't figure out why
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<referenceContainer name="t3footer">
<block class="MagentoFrameworkViewElementTemplate" name="wf.newsletter2" as="wf.newsletter2"
before="-"
template="Myvendor_Newsletter::newsletterprivacy.phtml"/>
</referenceContainer>
</layout>
I've also tried to put it in the shop/app/code/Myvendor/Newsletter/view/frontend/layout/default.xml
<?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">
<body>
<referenceBlock name="footer_links">
<block class="MagentoFrameworkViewElementTemplate" name="wf.newsletter" as="wf.newsletter"
before="-"
template="Myvendor_Newsletter::newsletterprivacy.phtml"/>
</referenceBlock>
</body>
</page>
but nothing happened
Can someone help please?
magento2 layout blocks footer
bumped to the homepage by Community♦ 4 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'm trying to add a block to a template built from scratch.
Using template-hints I can see that in the footer the following template is rendered
app/design/frontend/Merchant/merchant/Magento_Theme/templates/html/footer-cms.phtml
with some search I fount that the template is configured in app/design/frontend/Merchant/merchant/Magento_Theme/page_layout/1column.xml
:
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<!-- REMOVE MAGENTO HEADER & FOOTER -->
<referenceContainer name="header.container" remove="true"/>
<referenceContainer name="footer-container" remove="true"/>
<referenceContainer name="page.top" remove="true" />
<!-- INCLUDES TYPO3 HEADER & FOOTER -->
<referenceContainer name="page.wrapper">
<block class="MagentoFrameworkViewElementTemplate" name="t3header" as="t3header"
before="main.content"
template="Magento_Theme::html/header-cms.phtml"/>
<block class="MagentoFrameworkViewElementTemplate" name="t3footer" as="t3footer"
before="before.body.end"
template="Magento_Theme::html/footer-cms.phtml"/>
</referenceContainer>
</layout>
as I would like to add a newsletter subscription and terms checkbox in the footer, I am trying to do it in app/code/Myvendor/Newsletter/view/frontend/layout/1column.xml
but it doesn't show up even after clearing the cache and I can't figure out why
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<referenceContainer name="t3footer">
<block class="MagentoFrameworkViewElementTemplate" name="wf.newsletter2" as="wf.newsletter2"
before="-"
template="Myvendor_Newsletter::newsletterprivacy.phtml"/>
</referenceContainer>
</layout>
I've also tried to put it in the shop/app/code/Myvendor/Newsletter/view/frontend/layout/default.xml
<?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">
<body>
<referenceBlock name="footer_links">
<block class="MagentoFrameworkViewElementTemplate" name="wf.newsletter" as="wf.newsletter"
before="-"
template="Myvendor_Newsletter::newsletterprivacy.phtml"/>
</referenceBlock>
</body>
</page>
but nothing happened
Can someone help please?
magento2 layout blocks footer
I'm trying to add a block to a template built from scratch.
Using template-hints I can see that in the footer the following template is rendered
app/design/frontend/Merchant/merchant/Magento_Theme/templates/html/footer-cms.phtml
with some search I fount that the template is configured in app/design/frontend/Merchant/merchant/Magento_Theme/page_layout/1column.xml
:
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<!-- REMOVE MAGENTO HEADER & FOOTER -->
<referenceContainer name="header.container" remove="true"/>
<referenceContainer name="footer-container" remove="true"/>
<referenceContainer name="page.top" remove="true" />
<!-- INCLUDES TYPO3 HEADER & FOOTER -->
<referenceContainer name="page.wrapper">
<block class="MagentoFrameworkViewElementTemplate" name="t3header" as="t3header"
before="main.content"
template="Magento_Theme::html/header-cms.phtml"/>
<block class="MagentoFrameworkViewElementTemplate" name="t3footer" as="t3footer"
before="before.body.end"
template="Magento_Theme::html/footer-cms.phtml"/>
</referenceContainer>
</layout>
as I would like to add a newsletter subscription and terms checkbox in the footer, I am trying to do it in app/code/Myvendor/Newsletter/view/frontend/layout/1column.xml
but it doesn't show up even after clearing the cache and I can't figure out why
<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
<referenceContainer name="t3footer">
<block class="MagentoFrameworkViewElementTemplate" name="wf.newsletter2" as="wf.newsletter2"
before="-"
template="Myvendor_Newsletter::newsletterprivacy.phtml"/>
</referenceContainer>
</layout>
I've also tried to put it in the shop/app/code/Myvendor/Newsletter/view/frontend/layout/default.xml
<?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">
<body>
<referenceBlock name="footer_links">
<block class="MagentoFrameworkViewElementTemplate" name="wf.newsletter" as="wf.newsletter"
before="-"
template="Myvendor_Newsletter::newsletterprivacy.phtml"/>
</referenceBlock>
</body>
</page>
but nothing happened
Can someone help please?
magento2 layout blocks footer
magento2 layout blocks footer
edited May 9 '17 at 18:24
Amit Bera♦
57.7k1474172
57.7k1474172
asked May 9 '17 at 17:02
AndyAndy
566
566
bumped to the homepage by Community♦ 4 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 4 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Make sure your theme is not virtual
Go to theme table into db, and check type of your theme
after change 1 to 0, flush cache and check it.
Thanks for the reply Sunil. I'm sorry but in my 2.1.5 Magento installation I can't find that table
– Andy
May 10 '17 at 6:55
theme table contain from start of magento 2, please check page 2 of that phpmyadmin.
– Sunil Patel
May 10 '17 at 7:14
actually i'm not using PhpMyAdmin...anyway this is the result of the commandshow tables
on the db --> link can you see the themes table?
– Andy
May 10 '17 at 7:26
seems like lot of table missing please check with core magento2
– Sunil Patel
May 10 '17 at 7:43
add a comment |
t3footer
is a block:
<block class="MagentoFrameworkViewElementTemplate" name="t3footer" as="t3footer"
before="before.body.end"
template="Magento_Theme::html/footer-cms.phtml"/>
But you are using referenceContainer
:
<referenceContainer name="t3footer">
...
</referenceContainer>
So you need to use referenceBlock
<referenceBlock name="t3footer">
...
</referenceBlock>
You will need to clear cache if you have it enabled.
add a comment |
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%2f173681%2fmagento-2-block-in-footer-doesnt-show%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Make sure your theme is not virtual
Go to theme table into db, and check type of your theme
after change 1 to 0, flush cache and check it.
Thanks for the reply Sunil. I'm sorry but in my 2.1.5 Magento installation I can't find that table
– Andy
May 10 '17 at 6:55
theme table contain from start of magento 2, please check page 2 of that phpmyadmin.
– Sunil Patel
May 10 '17 at 7:14
actually i'm not using PhpMyAdmin...anyway this is the result of the commandshow tables
on the db --> link can you see the themes table?
– Andy
May 10 '17 at 7:26
seems like lot of table missing please check with core magento2
– Sunil Patel
May 10 '17 at 7:43
add a comment |
Make sure your theme is not virtual
Go to theme table into db, and check type of your theme
after change 1 to 0, flush cache and check it.
Thanks for the reply Sunil. I'm sorry but in my 2.1.5 Magento installation I can't find that table
– Andy
May 10 '17 at 6:55
theme table contain from start of magento 2, please check page 2 of that phpmyadmin.
– Sunil Patel
May 10 '17 at 7:14
actually i'm not using PhpMyAdmin...anyway this is the result of the commandshow tables
on the db --> link can you see the themes table?
– Andy
May 10 '17 at 7:26
seems like lot of table missing please check with core magento2
– Sunil Patel
May 10 '17 at 7:43
add a comment |
Make sure your theme is not virtual
Go to theme table into db, and check type of your theme
after change 1 to 0, flush cache and check it.
Make sure your theme is not virtual
Go to theme table into db, and check type of your theme
after change 1 to 0, flush cache and check it.
edited May 10 '17 at 9:17
Frank Groot
371425
371425
answered May 9 '17 at 18:30
Sunil PatelSunil Patel
1,2981612
1,2981612
Thanks for the reply Sunil. I'm sorry but in my 2.1.5 Magento installation I can't find that table
– Andy
May 10 '17 at 6:55
theme table contain from start of magento 2, please check page 2 of that phpmyadmin.
– Sunil Patel
May 10 '17 at 7:14
actually i'm not using PhpMyAdmin...anyway this is the result of the commandshow tables
on the db --> link can you see the themes table?
– Andy
May 10 '17 at 7:26
seems like lot of table missing please check with core magento2
– Sunil Patel
May 10 '17 at 7:43
add a comment |
Thanks for the reply Sunil. I'm sorry but in my 2.1.5 Magento installation I can't find that table
– Andy
May 10 '17 at 6:55
theme table contain from start of magento 2, please check page 2 of that phpmyadmin.
– Sunil Patel
May 10 '17 at 7:14
actually i'm not using PhpMyAdmin...anyway this is the result of the commandshow tables
on the db --> link can you see the themes table?
– Andy
May 10 '17 at 7:26
seems like lot of table missing please check with core magento2
– Sunil Patel
May 10 '17 at 7:43
Thanks for the reply Sunil. I'm sorry but in my 2.1.5 Magento installation I can't find that table
– Andy
May 10 '17 at 6:55
Thanks for the reply Sunil. I'm sorry but in my 2.1.5 Magento installation I can't find that table
– Andy
May 10 '17 at 6:55
theme table contain from start of magento 2, please check page 2 of that phpmyadmin.
– Sunil Patel
May 10 '17 at 7:14
theme table contain from start of magento 2, please check page 2 of that phpmyadmin.
– Sunil Patel
May 10 '17 at 7:14
actually i'm not using PhpMyAdmin...anyway this is the result of the command
show tables
on the db --> link can you see the themes table?– Andy
May 10 '17 at 7:26
actually i'm not using PhpMyAdmin...anyway this is the result of the command
show tables
on the db --> link can you see the themes table?– Andy
May 10 '17 at 7:26
seems like lot of table missing please check with core magento2
– Sunil Patel
May 10 '17 at 7:43
seems like lot of table missing please check with core magento2
– Sunil Patel
May 10 '17 at 7:43
add a comment |
t3footer
is a block:
<block class="MagentoFrameworkViewElementTemplate" name="t3footer" as="t3footer"
before="before.body.end"
template="Magento_Theme::html/footer-cms.phtml"/>
But you are using referenceContainer
:
<referenceContainer name="t3footer">
...
</referenceContainer>
So you need to use referenceBlock
<referenceBlock name="t3footer">
...
</referenceBlock>
You will need to clear cache if you have it enabled.
add a comment |
t3footer
is a block:
<block class="MagentoFrameworkViewElementTemplate" name="t3footer" as="t3footer"
before="before.body.end"
template="Magento_Theme::html/footer-cms.phtml"/>
But you are using referenceContainer
:
<referenceContainer name="t3footer">
...
</referenceContainer>
So you need to use referenceBlock
<referenceBlock name="t3footer">
...
</referenceBlock>
You will need to clear cache if you have it enabled.
add a comment |
t3footer
is a block:
<block class="MagentoFrameworkViewElementTemplate" name="t3footer" as="t3footer"
before="before.body.end"
template="Magento_Theme::html/footer-cms.phtml"/>
But you are using referenceContainer
:
<referenceContainer name="t3footer">
...
</referenceContainer>
So you need to use referenceBlock
<referenceBlock name="t3footer">
...
</referenceBlock>
You will need to clear cache if you have it enabled.
t3footer
is a block:
<block class="MagentoFrameworkViewElementTemplate" name="t3footer" as="t3footer"
before="before.body.end"
template="Magento_Theme::html/footer-cms.phtml"/>
But you are using referenceContainer
:
<referenceContainer name="t3footer">
...
</referenceContainer>
So you need to use referenceBlock
<referenceBlock name="t3footer">
...
</referenceBlock>
You will need to clear cache if you have it enabled.
answered May 10 '17 at 10:41
Ben CrookBen Crook
8,8242476
8,8242476
add a comment |
add a comment |
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%2f173681%2fmagento-2-block-in-footer-doesnt-show%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