Questions tagged [xml]

Denotes questions about XML files and XML processing.

Filter by
Sorted by
Tagged with
36
votes
6answers
41k 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 ...
31
votes
3answers
30k 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/...
30
votes
4answers
9k 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/...
22
votes
1answer
3k 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
4answers
2k 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 ...
18
votes
2answers
10k 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 ...
16
votes
1answer
8k 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="...
15
votes
2answers
7k views

Setting up an Admin Route in Magento 2

Looking at the core Magento 2 code, there seems to be two ways of setting up an admin route. The first #File: vendor/magento/module-media-storage/etc/adminhtml/routes.xml <config xmlns:xsi="...
14
votes
2answers
18k views

How to get data from config.xml of a module

In the module A I need to get some data from file config.xml of modules B and C. Are there any methods or classes dedicated for this? Especialy I need to get XML structure and values of node <...
14
votes
1answer
3k views

Improving error messages for XML compilation errors

Magento is fairly protective (as it should be) regarding the display of errors. When developer mode is enabled (as it should be during development), the application allows runtime error feedback to ...
13
votes
6answers
9k 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 ...
12
votes
3answers
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: crusaderhome Class:...
11
votes
4answers
21k 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 ...
11
votes
6answers
19k 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
1answer
2k views

What's your way of debugging xml related exceptions?

I'm coding with Magento 2 in gvim and I am new to Magento 2. There were many times i struggled to debug xml-related errors, well, each time with only luck. But situations like this makes me really ...
10
votes
2answers
8k 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
2answers
333 views

Override header Content and adding block

I have extended LUMA theme and want to customize header. I want to add static block before logo and want to move logo to center of page which is on left side. Final result will be [1] static ...
10
votes
1answer
6k 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\...
10
votes
3answers
3k views

XML Parsing Errors

I believe I have a syntax error or something? I'm confident it's either something to do with xml or syntax. Everything appears to be in order when i look into the file. This error is dealing with the ...
9
votes
4answers
5k 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" ...
9
votes
3answers
27k views

Remove Specific Top Links

I need to edit the Magento Top Links in a specific way and only need to show three links in below order Login Register Cart This would result in following Remove only Checkout Link and not Cart ...
9
votes
1answer
9k 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'...
9
votes
1answer
10k 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 ...
9
votes
1answer
1k 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
1answer
961 views

Magento 2 - block name vs as name

I've been doing some work in Magento 2 and have been overwriting some modules i've installed ( on the frontend ). However today i've just come across something that I've not encountered before. The ...
9
votes
1answer
1k views

Magento 2.1: how to remove argument and/or argument item from block?

I need to remove "from - to" price in bundle product page. So the question is how to remove item from argument? Block is created in magento2/vendor/magento/module-bundle/view/base/layout/...
8
votes
7answers
3k 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.
8
votes
4answers
20k 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/...
8
votes
2answers
2k views

Magento 2: What's the `ui_component` folder for?

In addition to containing familiar folders like layout, and templates, a Magento 2 module's view folder also contains a ui_component sub-folder. view/adminhtml/ui_component What is this folder for? ...
8
votes
1answer
3k 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 ...
8
votes
1answer
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 ...
8
votes
3answers
2k views

Magento Google sitemap Generation

I have generate google sitemap through Magento adminpanel. I have set Product URL Suffix(html) and Category URL Suffix(html) in the configuration. This suffix are not showing in sitemap.xml. It ...
8
votes
5answers
827 views

move module's external .js file code to template [phtml] file

We have a custom module with below code app/design/frontend/rwd/Theme1/layout/aitcg.xml <action method="addJs"><script>aitoc/aitcg/Aitcg/View/Abstract.js</script></action> ...
8
votes
1answer
2k views

Generate xml file programmatically

I need to generate an .xml file from my extension. Inside Namespace/Module/view/adminhtml/ui_component/ folder, I need to do this pro-grammatically because the .xml file will be generated based on ...
7
votes
6answers
10k 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 ...
7
votes
1answer
3k views

How do you use the API to add products to a bundle?

I'm developing a system that integrates an existing Django application with a Magento store. I've managed, using this library, to create bundle-type products, along with attributes and categories as ...
7
votes
1answer
12k views

Using the default Magento 2 template block class in a Module

I'm tying to add a simple block to the header using the default template class with the following code <block class="Magento\Framework\View\Element\Template" name="test.trigger" template="trigger....
7
votes
4answers
2k views

Creating a custom module to send order details to external supplier API via XML or JSON

I'm trying to write a custom module for Magento that when certain items are ordered and payment has been made, posts to our clothing supplier's site with details of the ordered item, delivery address ...
7
votes
2answers
2k views

How to change the order of CSS files. Load module's CSS before theme's CSS in magento2?

I want to load all extension's css before custom theme css in <head> tag. Right now extension's css file are loading after styles-m.css and styles-l.css so I can not override the extension css ...
7
votes
1answer
184 views

Packaging an “Errors” Skin Update

What's the right way to package a theme for the errors folder? That is, Magento's serves its 503 page and Store Exception 404 pages out of the following folder errors/* The errors folder contains ...
7
votes
1answer
411 views

Generate get parameter in XML layout Admin

I have a custom extension that generate grid using XML, the problem is that I need to add button which will generate link with a get parameter from get request that passed via url, the xml code for ...
6
votes
3answers
4k views

Can a Magento 2 Theme Modify the Layout?

In Magento 1, themes had a special file named local.xml. Through this file, a Magento 1 theme could directly modify the layout without needing to replace a specific layout update XML file. Does ...
6
votes
1answer
7k views

Difference between <update> and <reference> handle in magento layout files

I am bit confused in this two handle like when to use this two tags. Please clearfy for me like when to use this two.
6
votes
5answers
1k 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 ...
6
votes
1answer
332 views

Mage_Module_Helper_Data not found in Magento C.E 1.9

I am using magento 1.9 C.E and I have this issue whenever I try to disable any module from app/etc/modules/Mymodule_Custom.xml <active>false</false> It throws the error ...
6
votes
2answers
1k views

Magento 2: what is the search_engine.xml? How to declare a new search engine?

Some of you may have noticed the presence of the following file app/code/Magento/Search/etc/search_engine.xml: <?xml version="1.0"?> <engines xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
6
votes
2answers
381 views

How to include custom block in default block?

I have created a custom Extension. In this Extension, I need to show some content in product description page. How can i include that block using layout.xml. <catalog_product_view translate="...
6
votes
1answer
535 views

How to modify magnifier small lens and bigger preview

I have modified as follows <var name="magnifier"> <var name="fullscreenzoom">2</var> <!-- Zoom for fullscreen (integer)--> <var name="top"></...
6
votes
0answers
77 views

Inconsistent package.xml - Magento 1

I tried finding a Slack or Discord server for Magento before coming here. I am trying to submit a Magento 1 extension for technical review @ marketplace and the package.xml won't pass marketplace ...
6
votes
0answers
723 views

Magento 2 - Move the afterMethods item (Discount and Gift Card Code) to the Order Summary sidebar

I would like to move the afterMethods xml item which contains the Discount Code and Gift Card code under the billing-step in the module-checkout/view/frontend/web/checkout_index_index.xml so that it ...