Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change Contacts Page <title>-Tag with XML #5231

Closed
grasdaggel opened this issue Jun 24, 2016 · 11 comments
Closed

Unable to change Contacts Page <title>-Tag with XML #5231

grasdaggel opened this issue Jun 24, 2016 · 11 comments
Labels
bug report Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@grasdaggel
Copy link

Dear community,

I think I may found something unwanted.

Theres a layout default.xml for the contact page in

vendor/magento/module-contact/view/layout/ => default.xml
Line 13:
<argument name="label" xsi:type="string" translate="true">Contact Us</argument>

When I make an duplicate of this file and copy it to

app/design/frontend/ThemeName/Namespace/Magento_Contact/layout/ => default.xml

and change the line from "Contact us" to something else, the changes make no change in the <title>-Tag of the page itself.

Is this intended or a bug, or am I just simply doing something wrong here. What I want to do is to change the <title>-Tag of the contact page, since its not translateable over the backend right now.

This could be a feature in future releases, in order to keep Magento translateable.

@andimov
Copy link
Contributor

andimov commented Jun 24, 2016

@grasdaggel
Thank you for reporting this issue!
To allow us research the issue, please, provide the used version and description according to the template.

@grasdaggel
Copy link
Author

We are using Magento 2.0.4

Steps to reproduce

  1. copy file "default.xml" to /app/design/Theme/Name/Magento_Contact/layout/
  2. Change the labels content from "Contact Us" to something else
  3. rm -rf var/page_cache var/cache var/view_preprocessed pub/static/*
  4. php bin/magento setup:static-content:deploy de_DE en_US
  5. Check /contact

Expected result

  1. Title changes from "Contact Us" to something else

Actual result

  1. Title stays the same ("Contact Us")

@andimov
Copy link
Contributor

andimov commented Sep 2, 2016

I've created an internal ticket MAGETWO-58021 for this issue and linked it to this one.

@andimov andimov added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Sep 2, 2016
@grasdaggel
Copy link
Author

Any update on this? Its been a while.

@VincentMarmiesse
Copy link
Contributor

VincentMarmiesse commented May 28, 2017

Hello @grasdaggel,

You should create a contact_index_index.xml file into your layout folder.

Then, change the title in it:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>New contact page title</title>
    </head>
</page>

BUT you won't be able to translate it, the issue #2951 is still open and is talking about this bug.

@magento-engcom-team magento-engcom-team added 2.0.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 11, 2017
@bondimedical3
Copy link

I have tried to change the page title of the Contacts page on Magento 2.2 with XML and it still not working. This issue has been open for over 1 year. When is it going to be fixed?

@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch labels Oct 24, 2017
@magento-engcom-team
Copy link
Contributor

@grasdaggel, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9

@magento-engcom-team
Copy link
Contributor

@grasdaggel, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9

@valeriaabo
Copy link

Any solution?

@Anantkprajapati
Copy link

Anantkprajapati commented Apr 29, 2018

Hello @valeriaabo
You can change it using override Magento\Contact\Block\ContactForm and add code like below

CustomModule/Module/etc/di.xml
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Contact\Block\ContactForm" type="CustomModule\Module\Block\ContactUs\ContactForm" /> </config>

CustomModule/Module/Block/ContactUs/ContactForm.php

namespace CustomModule\Module\Block\ContactUs;
use Magento\Framework\View\Element\Template;
class ContactForm extends Magento\Contact\Block\ContactForm
{
public function _prepareLayout()
{
$this->pageConfig->getTitle()->set(__('Contact Us')); // add title here
}
}

This is works for me
Let me know if any

Thanks,
Anant Prajapati

@AnthonyBonnier
Copy link

AnthonyBonnier commented Jan 28, 2019

@Anantkprajapati : your solution worked very fine for me, thank you very much !

magento-engcom-team pushed a commit that referenced this issue Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

9 participants