I really need to know how to override languagefiles from extensions. For example, I have powermail installed and I have one language file from that extension that I need to override.
So I've got an extension called website_head and in that I created the file:
typo3conf\ext\website_head\Resources\Private\Language\Overrides\powermail\Resources\Private\Language\locallang.xlf
And the file I want to override is:
typo3conf\ext\powermail\Resources\Private\Language\locallang.xlf
When I clear the caches it does not change (but when I change the original it does change the text, it's just not overriding)
Also this is what's inside the override locallang.xlf file:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2014-05-02T12:00:00Z" product-name="powermail">
<header/>
<body>
<trans-unit id="validationerror_mandatory">
<source>Custom text</source>
</trans-unit>
</body>
</file>
</xliff>
Have a look at https://docs.typo3.org/typo3cms/CoreApiReference/7.6/Internationalization/Translation/Index.html:
You probably need to:
1) declare your XLF:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['EXT:powermail/Resources/Private/Language/locallang.xlf'][] = 'EXT:website_head/Resources/Private/Language/Overrides/powermail/Resources/Private/Language/custom.xlf';
2) override a label:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages" date="2013-03-09T18:44:59Z" product-name="website_head">
<header/>
<body>
<trans-unit id="validationerror_mandatory" xml:space="preserve">
<source>Custom text</source>
</trans-unit>
</body>
</file>
</xliff>
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
I'm new to Spring MVC. I'm trying out simple projects like Hello World.
I originally created a Hello World using IntelliJ IDEA IDE which worked just fine. However, when I tried Eclipse EE IDE, it returned a 404 message
HTTP Status 404 -
type Status report
message
description The requested resource is not available.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>FirstSpringMVCProject</display-name>
<servlet>
<servlet-name>spring-dispatcher</servlet-name> <!-- spring-dispatcher is the file named spring-dispatcher-servlet.xml -->
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>spring-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
spring-dispatcher.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:component-scan base-package="com.springmvcproject" />
<!-- HandlerMapping class -->
<!-- There are plenty of handler mapping classes, this is just an example of one of the classes available -->
<bean id="HandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />
<!-- defines the location or path where to look for views and what file extension to look for -->
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
HelloController.java
package com.springmvcproject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
#Controller
public class HelloController {
#RequestMapping("/hello")
public String helloWorld(){
return "hellopage";
}
}
hellopage.jsp
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h4> This is the hello page (HelloPage.jsp)</h4>
</body>
</html>
I don't see any reasons why it will not display the contents of the hellopage.jsp when I try to access http://localhost:8080/FirstSpringMVCProject/hello
Here's the screenshot of the folder structure. There are no warnings or error.
I don't know if I just missed something here or if Eclipse is requiring something else.
I hope you can help.
Thank you.
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>
According to Google the link tag containing the URL to the pubsubhubbub hub (This is a really terrible name) needs to go under the Atom entry element like so:
<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-GB" xmlns="http://www.w3.org/2005/Atom">
<!-- ... -->
<entry>
<link rel="hub" href="https://pubsubhubbub.appspot.com/" />
<!-- ... -->
</entry>
</feed>
However, all the implementations and blog posts I have seen add it to the feed element instead like so:
<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-GB" xmlns="http://www.w3.org/2005/Atom">
<!-- ... -->
<link rel="hub" href="https://pubsubhubbub.appspot.com/" />
<entry>
<!-- ... -->
</entry>
</feed>
What is the correct location for it?
It should be at the feed level: http://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.3.html#discovery (that is btw. the same spec, Google is referencing).