Questions tagged [xml]
Denotes questions about XML files and XML processing.
125
questions
46
votes
3
answers
100k
views
Remove block from layout XML in Magento 2
In Magento 1 I could remove a block added by a layout file by adding this in my layout-block
<remove ="block_id_here" />
How can I do the same for Magento 2?
As a practical exercise, let's say ...
14
votes
4
answers
39k
views
Add new tab on product detail page Magento 2 [duplicate]
I want to add an extra tab on product detail page just like review tab, It will look like a product question tab. How can I do this?
My block file:
namespace Example\ProductQuestion\Block;
use ...
37
votes
6
answers
43k
views
Debugging layout XML loading
TL;DR: is there a way I can debug the loading of the layout? As I believe one module's layout is conflicting with another.
Related to a previous question I made: How to make a module layout to be ...
2
votes
2
answers
2k
views
How to fetch post method xml data in Magento2 controller
We have to implement the punchout concept in magento2.
There is a 3rd party system they will send data using the cXML format to Magento 2 endpoint. We need to fetch that data in the Magento2 & ...
38
votes
4
answers
19k
views
Magento 2 xml validation
For a while Magento 2 had a way to validate (and autocomplete) any xml by using an XSD file.
For examplemodule.xml looked like this:
<?xml version="1.0">
<config xmlns:xsi="http://www.w3.org/...
35
votes
8
answers
38k
views
Admin config error: Undefined index: id in Iterator.php on line 59
Can someone please explain this error to me?
Exception #0 (Exception): Notice: Undefined index: id in /home/staging/vendor/magento/module-config/Model/Config/Structure/Element/Iterator.php on line 59
...
3
votes
2
answers
18k
views
Magento parser error "Start tag expected, '<' not found"
I am getting these errors in system.log.
2017-06-20T11:59:55+00:00 ERR (3): Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in home/www/lib/...
12
votes
1
answer
19k
views
Magento 2: How to add text within container via XML
I am attempting to render a single line of text prior to a Link list in the footer. Creating a template file to do this seems to be a waste of resources for this task. As I understood it, I could ...
2
votes
1
answer
5k
views
Magento 2 Block/Element order
A pretty basic question mainly because I'm still trying to wrap my head around Magento 2's templating system. But I'm just trying to switch the order of the mini-cart element and the search element ...
34
votes
3
answers
34k
views
Conditionally show/hide blocks in layout XML
How to conditionally add a block (depending on the configuration in the admin panel) in Magento's layout XML?
We can check if config is true on actions. In the example below, if sample/config/...
13
votes
3
answers
15k
views
Magento2: Default to sort by price descending not ascending
Ok so I have my categories sorting by price. Magento 2 defaults this to price ascending. But I would prefer it to be by price descending.
Pretty sure I can do this by customising ...
10
votes
4
answers
24k
views
Magento 2 - How to add custom css files into the head?
In Magento 1.x, I can add the CSS files into the head using the helper
like below code.
<reference name="head">
<action method="addCss"><stylesheet helper="module/helperclass/...
9
votes
4
answers
7k
views
Magento 2: How to use the Layout Handle customer_logged_in?
Does Magento 2 have such handle as customer_logged_in? If yes how can I use it?
I tried to create
../view/frontend/layout/customer_logged_in.xml
and added there <referenceBlock name="content" ...
8
votes
7
answers
11k
views
Magento2 How to move toolbar
Anyone have any idea about How to move toolbar before left and right sidebar in magento2 using XML?
Currently it is showing in Right side-bar.
6
votes
3
answers
10k
views
Magento 2 - Set the page layout dynamically based on admin configuration
I want to know how to set the page layout dynamically based on an extension's admin configuration values.
I found how to change the page layout in the layout xml file, http://devdocs.magento.com/...
22
votes
4
answers
4k
views
Extending the complexType named "imageType" with a custom image type
The goal of a module I'm currently developing is to add a custom image type called "opengraph_image". I added a new EAV attribute though my InstallData.php script which works fine. When I now login ...
22
votes
2
answers
20k
views
What are all the allowed `xsi:type` values in the xml's from Magento2
In Magento 2 (almost) all arguments listed in xml files have an attribute xsi:type that determine how the value of the argument is iterpreted.
For example, in di.xml file of the backend module there ...
15
votes
6
answers
23k
views
How can i hide Discount Code form checkout payment page in Magento 2?
I tried to hide the Discount Code field from checkout payment page, but i can't find anything in xml files.
For cart page, i found this field in checkout_cart_index.xml, and i was able to hide like ...
15
votes
6
answers
33k
views
Find out the "name" for a referenceBlock in Magento 2
I want to remove some blocks from my page. Say for example that I want to remove the container for the logo.
Then I create /app/design/frontend/MYVENDORNAME/MYTHEMENAME/Magento_Theme/layout/default....
11
votes
1
answer
9k
views
Magento 2 checkout index xml is not overriding
I am creating Magento 2 theme using the blank theme as the base. Now the problem is Magento 2 blank theme removing the top header, search bar, mini cart on http://www.yourdomain/checkout page
vendor\...
6
votes
5
answers
2k
views
Load review form on external page
By default the Magento URL for the review form is:
www.domain.com/(producturl)-reviews#review-form.
But in this page the review-form is a section in the reviews page.
I want to load the review-form ...
2
votes
1
answer
1k
views
Get source xml of error
Is there a way to resolve any xml-file that causes an error?
I cannot find the source file that causes this error (happens on checkout):
Magento\Framework\Config\Dom\ValidationException): Element '...
2
votes
2
answers
3k
views
Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]
I get the following repeated a lot in magento 1.9.1.1 system.log. any ideas?
2015-05-17T09:17:55+00:00 ERR (3): Warning: simplexml_load_string() [<a href='function.simplexml-load-string'>...
2
votes
2
answers
5k
views
Override base/ui_component/customer_form.xml
I'm trying to override the following file and I need the changes to show in adminhtml.
vendor/magento/module-customer/view/base/ui_component/customer_form.xml
I have copied the file to the location ...
2
votes
1
answer
2k
views
How to override Magento directory module /etc XML file
I am trying to override the ZIP code validation xml file in Magento's Directory module. I'm doing this because I want to enforce a space in UK postcodes. The path of the file I'm attempting to ...
30
votes
8
answers
69k
views
Magento 2: Call a static block using xml
How i include a static block in a page using xml. For example i created a static block with identifier promo. In magento 1 we include a static block using below code
<block type="cms/block" ...
23
votes
1
answer
4k
views
How can I have a custom XML file in modules merged as one in Magento 2? (MageStackDay mystery question 2)
MageStackDay bonus question for 500pts Bounty AND a the possibility of winning a free Z-Ray license for a year. More info can be found >> here <<
The questions are provided/inspired by Magento ...
21
votes
2
answers
22k
views
Magento 2 - ifconfig in layout xml
I'm working with magento 2.
I can use ifconfig attribute in the block code, and it works well.
<block class="Magento\Catalog\Block\Category\View" name="category_desc_main_column" template="...
12
votes
3
answers
30k
views
Magento new custom block module
I'm using Magento version 1.8.1.0.
I'm trying to create a new custom block module, which I'll use for creating a new home page.
Namespace: Crusader
Module: CLHomePage
Block Type: crusade home
Class:...
10
votes
1
answer
10k
views
How to prevent module rewrite class conflict in Magento
I have a class rewrite problem in Magento Onepage Checkout as I have a custom module in the local code pool and a third party extension in the community code pool both extending the same class...
I'...
8
votes
1
answer
2k
views
Magento 2 custom xml schema validation
This is a follow up of Magento 2 xml validation:
I understood how to map xsi:noNamespaceSchemaLocation in my IDE so I will get real time validation of my xmls.
But what if I have to create my own ...
7
votes
1
answer
8k
views
Magento2 : How to add a new product custom option type?
Two years ago, I developed under Magento 1.9 a module aiming at adding a new product custom option input type using this tutorial :
http://magento.ikantam.com/qa/custom-input-types-custom-options
I ...
6
votes
3
answers
25k
views
Adding a class to block Magento 2
I have the following custom xml inside of my Magento_theme > layout > default.xml
<referenceBlock name="top.links">
<block class="Magento\Framework\View\Element\Html\Link" name="...
6
votes
2
answers
9k
views
Create plugin LayoutProcessor::process vs override checkout_index_index.xml
To add a custom field, I can create a plugin and it will add input on the checkout.
1) Create plugin LayoutProcessor::process
Exapmle :
Namespace/Module/etc/frontend/di.xml
<config xmlns:xsi="...
5
votes
1
answer
3k
views
How to use multiple module dependencies
I have an xml like this.
<?xml version="1.0"?>
<config>
<modules>
<Vertax_Blog>
<active>true</active>
<codePool>local</codePool>
...
5
votes
2
answers
6k
views
Magento 2: How to remove Tooltips from checkout page?
I tried to remove tooltip in several ways but anything worked.
What's the XML code needed to do this and in which xml file do i have to make the change?
Here is one of my attempts
<...
3
votes
4
answers
12k
views
How to create custom cms page layout file?
In Magento 2, is there any solution to creating a custom layout XML file for custom cms page?
I want to add XML code and CSS and Js only for my custom cms page.
I know about there is one field ...
1
vote
1
answer
737
views
Editing an Existing Theme - Locating the XML
Sorry for the beginner question but I'm completely stuck, otherwise I wouldn't ask. I'm determined to learn Magento correctly and need pointing in the right direction before I can continue.
I'm ...
1
vote
1
answer
3k
views
Magento 2 Error : what is this error?
Tried to install a store locator extension.
When go to the front end producing this error.
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block': This ...
1
vote
2
answers
1k
views
Magento 2 | Add NOINDEX, FOLLOW to 404 CMS page using XML
How do I add NOINDEX, FOLLOW robots META tag to a custom 404 CMS page in Magento using XML, no matter what URL the page is served at?
By following the answer on this page, I was able to figure out ...
1
vote
2
answers
6k
views
If condition in layout xml tag
I have create one module for displaying latest product review, module works perfectly and reviews are display on frontend side.
But what I have requirement is admin can select where to display this ...
0
votes
5
answers
12k
views
How To Change Default Layout Template as 2column-left.phtml
I have just installed the Magento Bootstrap theme webcomm/magento-boilerplate
By default, Mangeto loads the 2column-right.phtml as the skeleton layout template. How do I ask it to load another ...
0
votes
2
answers
5k
views
Magento 2 Element 'file': This element is not expected
I am getting following error after upgrading magento 2.1 to 2.2.3
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'file': This element is not expected.
Line: ...
0
votes
1
answer
402
views
Magento "left" reference element xml layout problem
I have been trying to solve the issue for past few days with no luck.
The left sidebar is missing from all of the 2column-left pages. It worries me especially when it comes to customer account as the ...
0
votes
2
answers
4k
views
Want to remove a specific url from Magento sitemap.xml?
Want to remove a specific url from default magento sitemap.xml
I don't want this url http://www.globekart.com/coupon-partners.html in the sitemap http://www.globekart.com/sitemap/sitemap.xml
Please ...
15
votes
2
answers
16k
views
What is <update handle="customer_account"/>?
What is the Handler?
Can someone explain the below code?
<update handle="customer_account"/>
or same code like above for example :
<update handle="default"/>
and how it worked !?
10
votes
1
answer
4k
views
Updating ui_bookmark Table When Adding Columns via ui_component XML
In Magento 2, the ui_component based grids allow you to reorder columns and Magento will remember your settings the next time you log in. This is accomplished by Magento saving data in the ...
9
votes
2
answers
5k
views
Magento 2 - How to reset XML block arguments such as CSS
I'm wondering how to unset CSS that has been set through the XML, for example:
<block class="Magento\Framework\View\Element\Template" name="navigation.sections" before="-" template="Magento_Theme::...
9
votes
1
answer
4k
views
Magento 2 Add text in checkout page via XML
I'm trying to add custom text in checkout page via XML. I have my custom checkout_index_index.xml file with this inside:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="...
8
votes
1
answer
4k
views
Remove Title suffix from home page only
I have give Title suffix in magento system configuration like | Magento site. So this 'll add Title to every page in the store as suffix.
But when i goto home page title shows like Home | Magento ...