Questions tagged [xml]

Denotes questions about XML files and XML processing.

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 ...
11
votes
4answers
20k 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 ...
13
votes
5answers
8k 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 ...
2
votes
1answer
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 ...
31
votes
3answers
29k 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/...
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/...
5
votes
3answers
6k 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/...
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" ...
3
votes
2answers
7k views

Magento parser error “Start tag expected, '&lt;' 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, '&lt;' not found in home/www/lib/...
30
votes
4answers
8k 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/...
9
votes
1answer
9k 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 ...
17
votes
2answers
9k 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 ...
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\...
20
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 ...
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 ...
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 ...
2
votes
2answers
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'>...
21
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 ...
11
votes
5answers
18k 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....
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'...
4
votes
1answer
13k views

Move layered navigation block between product list toolbar and product list

I have moved the layered navigation block into the content section however I can't figure out how to position the block. I can only get it to show at the very top of the page or the bottom. I need it ...
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:...
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
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 ...
5
votes
1answer
4k 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 ...
1
vote
2answers
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 ...
1
vote
1answer
472 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 ...
5
votes
3answers
2k views

Magento 2 : Can the REST API return plain text?

I'm trying to make an endpoint for the Magento 2 Web API that simply returns plain text. Is this possible and if so, how? I'm currently trying this: webapi.xml: <route url="/V1/export/txt" ...
5
votes
1answer
2k 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> ...
0
votes
1answer
287 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
5answers
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
2answers
2k 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 ...
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="...
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 ...
5
votes
2answers
6k views

Warning: simplexml_load_file(): I/O Magento warning : failed to load external entity “/var/www/app/etc/local.xml”

I have this issue in my magento installation Warning: simplexml_load_file(): I/O warning : failed to load external entity "/var/www/app/etc/local.xml" in /var/www/app/Mage.php on line 767 setting ...
3
votes
2answers
4k views

How to move correctly block-search and minicart to panel wrapper? Magento 2

How to move correctly block-search and minicart to panel wrapper?
9
votes
1answer
926 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 ...
4
votes
2answers
17k views

Using “Layout Update XML” to add a block to the sidebar

When I create a new page in Magento 2 using the "two columns with left bar" layout it by default puts the wishlist in there. Using the "layout update XML" in the design options tab I can remove that ...
1
vote
3answers
6k views

Make merged js and css file asynchronous in magento

Hello actually is anyone know how to make the merged js and css file load asynchronous in magento i try add <param>defer</param> into <action method="addItem"><type>...
1
vote
0answers
2k views

Magento 2: Customising Checkout page – not working!

I am trying to remove input fields (Company and Telephone) from the Checkout page. I have followed what is explained on the M2 site here under 'Disable a component'. I have done the below but nothing ...
0
votes
2answers
4k views

Magento 2 - Rearrange the order of the Cart and Totals on the Order Summary Checkout Sidebar

I would like to move the Cart to be above the Totals in the Order Summary Checkout Sidebar. I have located both the Totals and Cart xml items in the checkout_index_index.xml in the Magento checkout ...
5
votes
3answers
864 views

Magento 2 catalog filter issue in frontend

I have filter catalog product collection based customer logged in frontend, Using event observer catalog_block_product_list_collection, Filter working fine. But the issue is found in Layered ...
5
votes
1answer
3k 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::...
3
votes
2answers
15k views

Adding custom css-files to theme (page.xml) - custom css-files for single storeviews

Question #1: For some reason, I can't seem to get my custom CSS file to be implemented into the theme. I've basically done this with the page.xml: Before: <action method="addItem"><type>...
2
votes
2answers
2k views

Magento 2 - Custom Homepage block not showing

I have developed a custom homepage layout and applied to the homepage. I've tried to add a created block in Magento_theme/templates/html/homepage.html but it is not displaying. Can anyone check ...
2
votes
1answer
633 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 ...
2
votes
3answers
2k views

Magento 2 | Add NOINDEX, NOFOLLOW to CMS page using Layout Update XML

How do I add the following robots META tag to a CMS page in Magento 2 using the Layout Update XML field? <meta name="robots" content="noindex,nofollow"/> I have tried the suggestions in the ...
1
vote
1answer
1k views

Magento 2 : Dropdown Option not Showing in Admin Form

I add dropdown field in admin form to showing status enable or disable like this : <field name="status"> <argument name="data" xsi:type="array"> <item name="...
1
vote
1answer
3k views

How to use “button” in UI component form - Magento 2?

I've written a custom module which adds a new tab to admin category edit page, using UI component form ([Vendor] \ [Module]\view\adminhtml\ui_component\category_form.xml). Everything works fine from ...
1
vote
1answer
2k views

Magento setup:upgrade fails with “Element 'type': Character content other than whitespace is not allowed because the content type is 'element-only'.”

We recently purchased software that runs as an extension for Magento 2. We purchased a brand new VPS setup, and turned it over to them for installation. They completed the installation and got their ...