Invalid template file on custom module
Issue
Exception #0 (MagentoFrameworkExceptionValidatorException): Invalid template file: 'TT::calculator.phtml' in module: 'Magento_Catalog' block's name: 'calculator.tab'
Layout Location:
app/code/TT/Calculator/view/frontend/layout/catalog_product_view.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="product.info.details">
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
Template Location:
app/code/TT/Calculator/view/frontend/templates/calculator.phtml
Questions
- I've seen some solutions where the *.phtml file is saved in app/design but I'm trying to get this to work in app/code. What have I missed?
- Also, does this "extend" catalog_product_view.xml or replace it?
magento2
add a comment |
Issue
Exception #0 (MagentoFrameworkExceptionValidatorException): Invalid template file: 'TT::calculator.phtml' in module: 'Magento_Catalog' block's name: 'calculator.tab'
Layout Location:
app/code/TT/Calculator/view/frontend/layout/catalog_product_view.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="product.info.details">
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
Template Location:
app/code/TT/Calculator/view/frontend/templates/calculator.phtml
Questions
- I've seen some solutions where the *.phtml file is saved in app/design but I'm trying to get this to work in app/code. What have I missed?
- Also, does this "extend" catalog_product_view.xml or replace it?
magento2
You have to change to TT_Calculator::calculator.phtml.
– Nero Phung
Nov 27 '17 at 15:56
I typo'd after fixing, making me think it didn't work. Thanks all!
– Craig
Nov 27 '17 at 16:37
add a comment |
Issue
Exception #0 (MagentoFrameworkExceptionValidatorException): Invalid template file: 'TT::calculator.phtml' in module: 'Magento_Catalog' block's name: 'calculator.tab'
Layout Location:
app/code/TT/Calculator/view/frontend/layout/catalog_product_view.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="product.info.details">
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
Template Location:
app/code/TT/Calculator/view/frontend/templates/calculator.phtml
Questions
- I've seen some solutions where the *.phtml file is saved in app/design but I'm trying to get this to work in app/code. What have I missed?
- Also, does this "extend" catalog_product_view.xml or replace it?
magento2
Issue
Exception #0 (MagentoFrameworkExceptionValidatorException): Invalid template file: 'TT::calculator.phtml' in module: 'Magento_Catalog' block's name: 'calculator.tab'
Layout Location:
app/code/TT/Calculator/view/frontend/layout/catalog_product_view.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="product.info.details">
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
Template Location:
app/code/TT/Calculator/view/frontend/templates/calculator.phtml
Questions
- I've seen some solutions where the *.phtml file is saved in app/design but I'm trying to get this to work in app/code. What have I missed?
- Also, does this "extend" catalog_product_view.xml or replace it?
magento2
magento2
edited Nov 27 '17 at 16:33
Craig
asked Nov 27 '17 at 15:55
CraigCraig
7371519
7371519
You have to change to TT_Calculator::calculator.phtml.
– Nero Phung
Nov 27 '17 at 15:56
I typo'd after fixing, making me think it didn't work. Thanks all!
– Craig
Nov 27 '17 at 16:37
add a comment |
You have to change to TT_Calculator::calculator.phtml.
– Nero Phung
Nov 27 '17 at 15:56
I typo'd after fixing, making me think it didn't work. Thanks all!
– Craig
Nov 27 '17 at 16:37
You have to change to TT_Calculator::calculator.phtml.
– Nero Phung
Nov 27 '17 at 15:56
You have to change to TT_Calculator::calculator.phtml.
– Nero Phung
Nov 27 '17 at 15:56
I typo'd after fixing, making me think it didn't work. Thanks all!
– Craig
Nov 27 '17 at 16:37
I typo'd after fixing, making me think it didn't work. Thanks all!
– Craig
Nov 27 '17 at 16:37
add a comment |
3 Answers
3
active
oldest
votes
1.You have to change the code to TT_Calculator::calculator.phtml
:
<?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="product.info.details">
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT_Calculator::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
2.Magento will check all the layout (XML file) in all the modules and merge them, not extend.
add a comment |
Your template file location should be TT_Calculator::calculator.phtml
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT_Calculator::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
add a comment |
I have resolved this issue now. The problem was the allow symlink of the system config:
php bin/magento config:set dev/template/allow_symlink 1 --lock-env
New contributor
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%2f203379%2finvalid-template-file-on-custom-module%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
1.You have to change the code to TT_Calculator::calculator.phtml
:
<?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="product.info.details">
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT_Calculator::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
2.Magento will check all the layout (XML file) in all the modules and merge them, not extend.
add a comment |
1.You have to change the code to TT_Calculator::calculator.phtml
:
<?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="product.info.details">
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT_Calculator::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
2.Magento will check all the layout (XML file) in all the modules and merge them, not extend.
add a comment |
1.You have to change the code to TT_Calculator::calculator.phtml
:
<?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="product.info.details">
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT_Calculator::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
2.Magento will check all the layout (XML file) in all the modules and merge them, not extend.
1.You have to change the code to TT_Calculator::calculator.phtml
:
<?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="product.info.details">
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT_Calculator::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
</referenceBlock>
</body>
</page>
2.Magento will check all the layout (XML file) in all the modules and merge them, not extend.
answered Nov 27 '17 at 15:59
Nero PhungNero Phung
8341420
8341420
add a comment |
add a comment |
Your template file location should be TT_Calculator::calculator.phtml
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT_Calculator::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
add a comment |
Your template file location should be TT_Calculator::calculator.phtml
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT_Calculator::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
add a comment |
Your template file location should be TT_Calculator::calculator.phtml
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT_Calculator::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
Your template file location should be TT_Calculator::calculator.phtml
<block class="MagentoCatalogBlockProductView" name="calculator.tab" template="TT_Calculator::calculator.phtml" group="detailed_info">
<arguments>
<argument translate="true" name="title" xsi:type="string">Calculator</argument>
</arguments>
</block>
answered Nov 27 '17 at 15:57
harriharri
2,8841550
2,8841550
add a comment |
add a comment |
I have resolved this issue now. The problem was the allow symlink of the system config:
php bin/magento config:set dev/template/allow_symlink 1 --lock-env
New contributor
add a comment |
I have resolved this issue now. The problem was the allow symlink of the system config:
php bin/magento config:set dev/template/allow_symlink 1 --lock-env
New contributor
add a comment |
I have resolved this issue now. The problem was the allow symlink of the system config:
php bin/magento config:set dev/template/allow_symlink 1 --lock-env
New contributor
I have resolved this issue now. The problem was the allow symlink of the system config:
php bin/magento config:set dev/template/allow_symlink 1 --lock-env
New contributor
New contributor
answered 15 mins ago
Hào Nghiêm XuânHào Nghiêm Xuân
1
1
New contributor
New contributor
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%2f203379%2finvalid-template-file-on-custom-module%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
You have to change to TT_Calculator::calculator.phtml.
– Nero Phung
Nov 27 '17 at 15:56
I typo'd after fixing, making me think it didn't work. Thanks all!
– Craig
Nov 27 '17 at 16:37