Questions tagged [template]
The folder that contains all the `phtml` files used to display at frontend or backend.
1,406
questions
1
vote
4
answers
146
views
Help with overwriting .phtml file in Magento 2.2.7
I need some advice on how to overwrite category description 'block?' from file
/app/design/frontend/Mgs/mgsblank/Magento_Catalog/templates/category/description.phtml
I want to use my own module ...
0
votes
0
answers
107
views
Invalid template file in Magento 2.2.7
1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'MGS_Mmegamenu::active_menu.phtml' in module:
'' block's name: 'active.megamenu.script'
I'...
0
votes
0
answers
318
views
Edit Order return Guest form
I like to edit order return guest form. I edited in
app/design/frontend/[theme]/Magento_Sales/templates/guest/form.phtml
but form settings are in
vendor/magento/module-sales/Helper/Guest.php.
...
0
votes
2
answers
294
views
Add a class or id when changing the language magento 2.3.1
pls help me! How to Add a class or id to html or body when changing the language magento 2
0
votes
5
answers
1k
views
New order email template - price decimal place
we have amended our Magento 2.1 to use and store prices with 4 decimal places. But then used some JS to trim/round-up on the frontend to 2 decimal places.
However, on the email templates, the price ...
6
votes
1
answer
180
views
How to create custom XHTML template system in magento 2?
Hey guys, I want to know how to create a custom XHTML system with the custom module or via core file system in Magento 2 & how it works?
4
votes
2
answers
1k
views
Magento 2 blocks and templates
Following are the 4 conditions.
Single block and multiple templates - I think this is possible and we use it frequently while customizing Magento.
Multiple blocks and single template - Never seen ...
1
vote
0
answers
42
views
Customizing template in magento2
I need help in 2 questions:
1 - Put a delay for the newsletter popup to open after the uploaded
website + 10s
2 - I have 2 javascript (tidio and whatshelp.io) in
the footer, the ...
0
votes
1
answer
783
views
How to render a block/template after page load
I need to know whether we can render a block or a phtml template file after the page load.
I have added the block and template file in the layout file and it works fine.
But i dont want that data to ...
0
votes
1
answer
153
views
Add content of static block as new tab to product detail page
I created 3 static blocks with just a random headline for now, where I want to add html content later.
the ids of the blocks are:
warranty
instructions
certificates
I then created 3 .phtml files ...
0
votes
1
answer
35
views
Where block template for email is located
I found in an old Magento 1.3 installation following code in an email template:
{{block type="symmetrics_impressum/impressum" value="emailfooter"}}
It works and this snippet implement my imprint in ...
0
votes
3
answers
1k
views
Layout - Pass variables from parent to child
How can I access variables defined in the parent template inside a child template?
Example -> I added a new block with name product.info.grouped.news_flag as child of the block with name product.info....
2
votes
2
answers
2k
views
Magento 2 pass data from template html to phtml file
So far I have created file MyModule/ProductAlert/view/frontend/email/stock.html -
<!--@subject {{trans "Products back in stock alert"}} @-->
<!--@vars {
"var alertGrid|raw":"Alert Data Grid"...
0
votes
2
answers
370
views
<arguments> approach not overriding the template file
I wanted to override vendor/magento/module-sales/view/adminhtml/templates/items/column/name.phtml template.
And created new layout xml update as:
File: app/code/MagePsycho/CustomInvoice/view/...
2
votes
1
answer
512
views
Review form in custom template not working Magento 2.3.4
I have created a custom template for the product page based on the attribute value.
in my template i used below code to display the review section.
<?php echo $block->getLayout()->...
0
votes
1
answer
214
views
Where body tag styles are defined in Magento 1.9
I have spent several hours trying to figure out this.
The fact is that I have a site that has a BODY tag with certain classes for style. I need to change those classes, but I have not find where are ...
2
votes
0
answers
2k
views
Magento 2 - Override Swatches renderer.phtml
I would like to override file :
app/code/Magento/Swatches/view/frontend/templates/product/layered/renderer.phtml
In my own theme :
app/design/frontend/[VendorName]/[theme]/Magento_Swatches/...
1
vote
1
answer
163
views
Magento 1.9 template file calling from base and not from my custom theme
In Magento 1.9 I have created my custom theme.
Also, I have created one new module in the 'local' code pool.
Everything workes fine but the template files are loading from the base like
frontend/...
0
votes
1
answer
355
views
How to convert template variables to custom data in magento 2
I have configured a back-end screen where I will enter a string as
{{price}} for guest user. click here {{sign_up}}.
So after I fetch the field value I want to dynamically replace the {{price}} ...
1
vote
1
answer
2k
views
KnockoutJS Which Model does the Minicart use?
So, i'm very new when it comes to using KnockoutJS but i've been doing some reading around it and to my knowledge each template file has its own corresponding model.
However, as i'm looking through ...
0
votes
1
answer
118
views
How array set in email.html file
i make custom mail template.
my template variables are $TemplateParameter=[
'customerName'=>$getOrderParams['customerName'],
'orderItems'=>$getOrderParams['productinfo']
...
0
votes
1
answer
766
views
Magento 2 Error filtering template?
After installed module we are getting one error message called
"Error filtering template: You cannot define a correlation name
'stock' more than once"
Mentioned with below code. Can anyone ...
0
votes
1
answer
613
views
How to use different page layouts depends on base layout specified?
I have to use different page layouts (<page>) depends on base layout (<layout>) specified for a product.
For example,
if I select a layout in product's 'Design' menu with the name
...
2
votes
2
answers
3k
views
Magento 2 - Override template files in module
What is the correct way to override a template file ? I need to display custom text in place of In Stock and Price on the product page.
I want to override the template -
Magento_Catalog/view/...
1
vote
2
answers
2k
views
Adding contents to default customer sign up / create account page - Magento 2
I would like to add a banner image and some contents to default create customer account page at www.domain.com/customer/account/create/, how do i do it? Or Can I add a CMS Page or static block to it?
1
vote
3
answers
2k
views
Why data bind template is not working on 2.2 or greater?
I was studying about Knockout.js and how it works with Magento 2.
Then I reached the topic: template integration, in the first sample of it I'm presented to this notation:
<div data-bind="...
1
vote
1
answer
50
views
Incorrect behavior when sending email with use a block inside a template
When developing the module I encountered the following problem:
inside the my controller (class Index extends \Magento\Framework\App\Action\Action) there is a method that calls a method to send email ...
2
votes
2
answers
84
views
Best way to change block´s template?
I've been studing for the Magento certification and I came across a question in the swiftotter practice exam that said:
Can someone explain me why the answer I chose is incorrect? I thought the way ...
3
votes
1
answer
94
views
Is it possible to append a block to the footer in admin dashboard?
I'm trying to append a block to the footer but only on the dashboard page i.e.
<footer>
[New Template]
[Core Content]
</footer>
How can I achieve this? I've tried a layout file with the ...
3
votes
2
answers
3k
views
What is the meaning of triple curly braces {{{ }}} in phtml template files? When and how do we use them?
There is a phtml template file in one of the third party Magento 2 extension which has triple curly braces {{{ }}} in it.
When is this notation used, What does it represent?
2
votes
1
answer
40
views
Magento does not show template
I can't figure out why magento is not loading my template:
The template is located at app/design/frontend/base/default/template/fekete/Newsletter2Go/customer/account/dashboard/info.phtml
I double ...
4
votes
3
answers
7k
views
Invalid template file in Magento 2.3
I have been reading the forum but I can't find any solution to solve my case.
I have a custom module where I'm getting the error:
1 exception(s): Exception #0
(Magento\Framework\Exception\...
0
votes
1
answer
523
views
Magento2: How to change layout product detail
I want to change size and layout product detail:
from:
similar to:
details.phtml
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @...
-1
votes
1
answer
856
views
Fatal error: Uncaught Error: Call to a member function getPageLayout() on null in
Magento 2.2.5 version. Every time trying to go to product page I get error:
Fatal error: Uncaught Error: Call to a member function getPageLayout() on null in /var/www/html/app/code/MGS/Mpanel/Helper/...
1
vote
1
answer
243
views
different template files for product detail page of simple and grouped product types. - Magento 2.2.x
I have 2 types of product in my website.
1) simple products and
2) grouped products
i wanted different design for both this types of product types. so how can i have different template file for ...
2
votes
0
answers
34
views
How to deal with multiple extensions overriding the same template file?
I have two extensions which load their own template for the block with name customer_form_register in customer_account_create
The first extensions overrides the template to add a new field to the ...
1
vote
1
answer
116
views
Invalid template file within custom template
I am trying to work out why related products arent being displayed on my frontend, and when I check the logs I am presented with the below.
Any help would be great.
Thanks
[2019-02-14 13:56:02] main....
1
vote
0
answers
61
views
subcategories collapse after click in menu
When I click on parent category then sub category opens and when I click on subcategory the respective page open but the menu collapse it does not show on which category and sub-category we are.
Can ...
0
votes
1
answer
1k
views
Magento2 render custom block in adminhtml layout.xml
I can not render my custom block within my custom template,
Point is on newsletter subscriber, I extend newsletter_subscriber_form.xml,
Add container within my block but it says that template is ...
1
vote
1
answer
283
views
Magento 2 Templates: How `$block` is assign in template?
Can you please tell me where the assignment of the $block variable to the template occurs?
\Magento\Framework\View\TemplateEngine\Php::render()
I found :
$tmpBlock = $this->_currentBlock;
$...
1
vote
1
answer
352
views
How add a country selector in the header section?
I need add a country selector in the header section, next to the currency selector. How is the right way to do this?
Edit:
I realized that there was not much information in my question, so it was ...
1
vote
1
answer
304
views
finding location of $this->getLinks() in template
I have a phtml template that has the following code in it:
<?php $links = $this->getLinks(); ?>
<ul class="social-links">
<?php foreach ($links as $name => $group): ?>
...
2
votes
3
answers
7k
views
Magento 2 override minicart.phtml in custom module
I'm trying to override minicart.phtml file from Magento2\vendor\magento\module-checkout\view\frontend\templates\cart\minicart.phtml to my custom module
Magento2\vendor\XXXX\YYYY\view\frontend\...
0
votes
0
answers
35
views
Install layouts and templates from the theme divante
I installed the theme https://github.com/DivanteLtd/magento2-rapid-theme, the theme got up, everything is in order, I don’t understand how to set the main page to make it as an example.
The topic has ...
0
votes
2
answers
1k
views
Show Separate product detail page based on attribute value in Magento 2
Shall we load separate product detail page based on the product attribute value in magento2 ?
I have created the attribute product called "type_of_product"
If this attribute value is "Test 2", I ...
1
vote
1
answer
1k
views
Magento 2 knockout js dynamic button title in minicart
I'm trying to add dynamic checkout button title in minicart using knockout js. Button title will be configured in admin configs. I configured in minicart.js But I dont know how to use/call in template ...
3
votes
2
answers
459
views
Magento 1.9xx - Not valid template file
Today I took a look into the system.log from one of our Magento shops and I saw that there is an error:
2019-01-20T09:05:52+00:00 CRIT (2): Not valid template file:frontend/base/default/template/...
0
votes
3
answers
784
views
Magento2: How to center box with price, product name etc
I try to center box with product details:
So, in list.phtml I found code responsible for this box.
<div class="product details product-item-details">
<hr />
...
0
votes
0
answers
75
views
Magento2: How to check template name
I want to check template name for this website:
https://sportofino.com/
I try to find in source skin but cannot find. Anyone help?
0
votes
1
answer
124
views
override wysiwyg_images.files
I try to override Magento_Cms::browser/content/files.phtml but when i test , the block is dont display , and i dont know why
i have the next extructure
<Vendor>_<Module>
├── <Stuff&...