magento 2 cms_index_index not working - magento2

/app/design/frontend/some/theme/Magento_Cms/layout/cms_index_index.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block type="\Magento\Cms\Block\Block" name="index.banner">
<arguments>
<argument name="block_id" xsi:type="string">index_banner</argument>
<arguments>
</block>
</referenceContainer>
</body>
It does not show index_banner static on the home page.
What do the error?
What needs to be done in the background or setting?

Their mistakes
<block class="Magento\Cms\Block\Block" name="index_banner">
<arguments>
<argument name="block_id" xsi:type="string">index_banner</argument>
</arguments>

Related

Each layer of the eclipse package shows all paths

My version of eclipse is 2022-03. I downloaded and installed spring tools4 from the Eclipse Marketplace and created a boot project through file - > New - > spring starter project,I have set Package Presentation - > Hierarchical.
Although the eclipse package is layered, each layer shows all paths.
uncropped screenshot Boot Project hierarchical
I test that the package of an ordinary Java Project is normal hierarchical.
Java Project hierarchical
This is my .project file.
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>demo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>

Magento 2 : template file not overridden correctly

I have wrote the below code to override magento 2 frontend customer edit form.
customer_account_edit.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>
<referenceContainer name="content">
<referenceBlock name="customer_edit">
<action method="setTemplate">
<argument name="template" xsi:type="string">Test_Modul::customer/form/edit.phtml</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
</page>
But it is not working. Please help me to fix it?
<?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>
<referenceContainer name="content">
<referenceBlock name="customer_edit">
<action method="setTemplate">
<argument name="template" xsi:type="string">Emipro_Module::customer/form/edit.phtml</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
</page>
I have used above code and its work fine for me.
Also Your code seems right. Did you make your phtml file under proper location like: Vendor/Module_Name/view/frontend/templates/customer/form/edit.phtml
Also check that if there is no any spell mistake in your module name or path.
customer_account_edit.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>
<referenceContainer name="content">
<referenceBlock name="customer_edit">
<action method="setTemplate">
<argument name="template" xsi:type="string">Test_Module::customer/form/edit.phtml</argument>
</action>
</referenceBlock>
</referenceContainer>
</body>
you need to create a template file for this on the Path.
app/code/Test/Module/view/frontend/templates/customer/form/edit.phtml

Magento 2: Left Category Sidebar from Sebwite

I'm using Magento 2 and still struggle implementing this category listing url:
https://github.com/Sebwite/magento2-category-sidebar
What is the proper way to do this line below? Which file should i edit?
You should implement the block Sebwite\Sidebar\Block\Sidebar in your theme to make this extension work.
As i am new to this, i cannot find any instruction regarding this knowing i should have missed something here.
I have try several attempts but it seems the left category still not showing.
I have tried to edit /vendor/magento/theme-frontend-luma/Magento_Catalog/layout/default.xml but still no luck.
Below is my default.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header-wrapper">
<container name="compare-link-wrapper" label="Compare Link Wrapper" as="compare-link-wrapper" after="top.search" htmlTag="ul" htmlClass="compare wrapper">
<block class="Magento\Framework\View\Element\Template" name="catalog.compare.link" before="-" template="Magento_Catalog::product/compare/link.phtml">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="compareProducts" xsi:type="array">
<item name="component" xsi:type="string">Magento_Catalog/js/view/compare-products</item>
</item>
</item>
</argument>
</arguments>
</block>
</container>
</referenceContainer>
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<block class="Sebwite\Sidebar\Block\Sidebar" name="category-sidebar" template="Sebwite_Sidebar::sidebar.phtml" />
</body>
</page>
Any suggestions is very appreciated.
Thank you
So this works for me.
Go to your magento luma catalog-layout default.xml and change it to below:
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header-wrapper">
<container name="compare-link-wrapper" label="Compare Link Wrapper" as="compare-link-wrapper" after="top.search" htmlTag="ul" htmlClass="compare wrapper">
<block class="Magento\Framework\View\Element\Template" name="catalog.compare.link" before="-" template="Magento_Catalog::product/compare/link.phtml">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="compareProducts" xsi:type="array">
<item name="component" xsi:type="string">Magento_Catalog/js/view/compare-products</item>
</item>
</item>
</argument>
</arguments>
</block>
</container>
</referenceContainer>
<referenceContainer name="sidebar.additional">
<block class="Sebwite\Sidebar\Block\Sidebar" name="category-sidebar" template="Sebwite_Sidebar::sidebar.phtml" />
</referenceContainer>
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
</body>
</page>

How to remove "My Wish List" and "Compare Products" blocks from Magento 2.0 Luma template?

I have spent a lot of hours trying to remove "My Wish List" and "Compare Products" blocks from Luma template. Besides, I need to change and remove some of the bottom links.
I cannot find where to modify. Can you help me, please?
Thanks
I've tried following step it worked for me.
1. My Wish List
For wish List you need to remove it via Admin > Stores > Configuration > Customers > Wish list > General Options
make to enabled to no and then save it.
2. Compare Product
Here you need to do some coding level changes. follow me
Go to vendor > magento > theme-frontend-luma > Magento_Catalog > layout > default.xml
Open this file find this tag "" and before body end tag put the following code
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
Make sure this will remove compare product from category product
listing however you can uses this to any layout.
Once you done with this don't forget to clearing cache if enable otherwise you will not get desirable output.
Let me know if you have still any query
Magento 2.2.3 - Get rid of the compare
So I had the same issue, but found out I needed to add a way more to the default.xml to get rid of the compare:
<referenceBlock name="catalog.compare.sidebar" remove="true"/> <!-- Remove sidebar -->
<referenceBlock name="catalog.compare.link" remove="true"/> <!-- Remove link in header -->
<referenceBlock name="related.product.addto.compare" remove="true"/> <!-- Related product -->
<referenceBlock name="category.product.addto.compare" remove="true"/> <!-- Category add compare -->
<referenceBlock name="view.addto.compare" remove="true" /> <!-- Product addto compare -->
instead to remove parent block just remove to the point block
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="wishlist_sidebar" remove="true"/>
Update :for Magento 2.1
<referenceContainer name="content">
<referenceBlock name="catalog.compare.sidebar" remove="true" />
<referenceContainer name="sidebar.additional" remove="true" />
</referenceContainer
A quick note for Enterprise users: you may need to remove the "multiple wishlist" block as well:
<referenceBlock name="multiple-wishlist_sidebar" remove="true" />
I used all of these to remove traces of wishlist and compare from category and product page + the related and upsells on product page. Tested on v2.3.5-p1:
<referenceBlock name="wishlist_sidebar" remove="true" />
<referenceBlock name="catalog.compare.sidebar" remove="true"/>
<referenceBlock name="upsell.product.addto.wishlist" remove="true" />
<referenceBlock name="related.product.addto.wishlist" remove="true" />
<referenceBlock name="related.product.addto.compare" remove="true" />
<referenceBlock name="view.addto.wishlist" remove="true" />
<referenceBlock name="view.addto.compare" remove="true" />
Login to Magento back end. Goto Store->Configuration.
Under Customer ->wishlist you can able to disable the option.
(M2.1)
If you don't want to create a custom theme and/or prefer to work from the backend, you can do the following in the backend.
Navigate to the cms page, category or product page you want to alter.
Example for Category Page: under Design -> Layout Update XML add the following code:
<referenceContainer name="content">
<referenceBlock name="catalog.compare.sidebar" remove="true" />
<referenceContainer name="sidebar.additional" remove="true" />
</referenceContainer>
Note: if you want additional blocks to remain in the sidebar, set the additional container to "false" like this:
<referenceContainer name="content">
<referenceContainer name="sidebar.additional" remove="false" />
</referenceContainer>
For removing compare links
<referenceBlock name="catalog.compare.sidebar" remove="true"/> <!-- Remove sidebar -->
<referenceBlock name="catalog.compare.link" remove="true"/> <!-- Remove link in header -->
<referenceBlock name="related.product.addto.compare" remove="true"/> <!-- Related product -->
<referenceBlock name="category.product.addto.compare" remove="true"/> <!-- Category add compare -->
<referenceBlock name="view.addto.compare" remove="true" /> <!-- Product addto compare -->
For wish List:
You can remove it in Admin > Stores > Configuration > Customers > Wish list > General Options make to enabled to no and then save it.
or
<referenceBlock name="wishlist_sidebar" remove="true"/>
It's almost the very same way
<referenceBlock name="block.name.wantoberemoved" remove="true"/>
Remove compare products from the sidebar
<referenceBlock name="catalog.compare.sidebar" remove="true" />
Remove Wishlist from the sidebar
<referenceBlock name="wishlist_sidebar" remove="true" />
Override core module like below:
code/Custom/Wishlist:
code/Custom/Wishlist/registration.php
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Custom_Wishlist',
__DIR__
);
code/Custom/Wishlist/composer.json
{
"name": "custom/wishlist-magento2",
"description": "N/A",
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"type": "magento2-module",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"version": "1.0.0",
"authors": [
{
"name": "Pramod Kharade",
"email": "support#blazeclan.com",
"homepage": "https://www.blazeclan.com/",
"role": "Developer"
}
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Custom\\wishlist\\": ""
}
}
}
code/Custom/Wishlist/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Custom_Wishlist" setup_version="1.0.0" >
<sequence>
<module name="Magento_Wishlist" />
</sequence>
</module>
</config>
code/Custom/Wishlist/etc/view/frontend/layout/default.xml
<?xml version="1.0"?>
<referenceContainer name="sidebar.additional" remove="true">
<block class="Magento\Wishlist\Block\Customer\Sidebar" name="wishlist_sidebar" as="wishlist" template="Magento_Wishlist::sidebar.phtml"/>
</referenceContainer>
</body>

resources not linked into final APK

I can run my app fine in the emulator and with the same source compile a final APK, but on another computer with exactly the same environment (Android-SDK, Eclipse and sources!) copied there, the project's resources are not compiled into the final APK when creating a distribution package.
As a consequence, the distribution APK is only 122k in size, while the correct size is supposed to be about 290k. It is displayed as "invalid" when trying to install it on a device.
Any idea why? It doesn't make a difference whether I'm using the original proguard file or an empty one.
I mean the file .project starting with a dot. It should look similar to this
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MiniCallWidget</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>