Magento 2.2.2 - Display Customer Account header dropdown and remove Sign Out link post login The Next CEO of Stack OverflowHow can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Change “My Account” to “Sign in/Sign out” option in header in magento rwd theme?Magento 2.2.2 - Remove default welcome message and show username post loginRemove “Sign Out” link in header panel but keep “Sign Out” link in dropdownMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom Options

Are there languages with no euphemisms?

How to write papers efficiently when English isn't my first language?

Can "Reverse Gravity" affect Meteor Swarm?

Grabbing quick drinks

How to disable updates in WordPress theme

What happens if you roll doubles 3 times then land on "Go to jail?"

Implement the Thanos sorting algorithm

Failed to fetch jessie backports repository

Is a stroke of luck acceptable after a series of unfavorable events?

Creating a generator function for a large data set for a neural network

How can I quit an app using Terminal?

What is the purpose of the Potent Cantrip ability?

Why do remote companies require working in the US?

How do I construct this japanese bowl?

What is the point of a new vote on May's deal when the indicative votes suggest she will not win?

How to pronounce the slash sign

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

Only print output after finding pattern

Why does standard notation not preserve intervals (visually)

Why use "finir par" instead of "finir de" before an infinitive?

Opposite of a diet

Why is Miller's case titled R (Miller)?

declare as function pointer and initialize in the same line

How do I go from 300 unfinished/half written blog posts, to published posts?



Magento 2.2.2 - Display Customer Account header dropdown and remove Sign Out link post login



The Next CEO of Stack OverflowHow can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Change “My Account” to “Sign in/Sign out” option in header in magento rwd theme?Magento 2.2.2 - Remove default welcome message and show username post loginRemove “Sign Out” link in header panel but keep “Sign Out” link in dropdownMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom Options










3















After successful login, Luma theme shows customer account details in dropdown on header as seen in below image



enter image description here



I need to replicate the same in our custom theme which has Blank as its parent.



Vendor/Theme/Magento_Theme/layout/default.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="header.panel">
<block class="MagentoFrameworkViewElementHtmlLinks" name="header.links">
<arguments>
<argument name="css_class" xsi:type="string">header links</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>


Vendor/Theme/Magento_Customer/layout/default.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>
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountCustomer" name="customer" template="Magento_Customer::account/customer.phtml" before="-"/>
<block class="MagentoCustomerBlockAccountAuthorizationLink" name="authorization-link-login" template="Magento_Customer::account/link/authorization.phtml">
</block>
</referenceBlock>

<move element="top.links" destination="customer"/>
</body>
</page>


Vendor/Theme/Magento_Customer/templates/account/customer.phtml



<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile
/** @var MagentoCustomerBlockAccountCustomer $block */
?>
<?php if($block->customerLoggedIn()): ?>
<li class="customer-welcome">
<span class="customer-name"
role="link"
tabindex="0"
data-mage-init='"dropdown":'
data-toggle="dropdown"
data-trigger-keypress-button="true"
data-bind="scope: 'customer'">
<span data-bind="text: customer().fullname"></span>
<button type="button"
class="action switch"
tabindex="-1"
data-action="customer-menu-toggle">
<span><?= $block->escapeHtml(__('Change')) ?></span>
</button>
</span>
<script type="text/x-magento-init">

"*":
"Magento_Ui/js/core/app":
"components":
"customer":
"component": "Magento_Customer/js/view/customer"





</script>
<?php if($block->getChildHtml()):?>
<div class="customer-menu" data-target="dropdown">
<?= $block->getChildHtml() ?>
</div>
<?php endif; ?>
</li>
<?php endif; ?>


Here, when user is not logged in, I can see Sign In link but after user logs in I can see sign-out in user account dropdown on header as well as besides it. How do I resolve this?










share|improve this question
























  • have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…

    – fogx
    Mar 29 '18 at 15:21















3















After successful login, Luma theme shows customer account details in dropdown on header as seen in below image



enter image description here



I need to replicate the same in our custom theme which has Blank as its parent.



Vendor/Theme/Magento_Theme/layout/default.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="header.panel">
<block class="MagentoFrameworkViewElementHtmlLinks" name="header.links">
<arguments>
<argument name="css_class" xsi:type="string">header links</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>


Vendor/Theme/Magento_Customer/layout/default.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>
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountCustomer" name="customer" template="Magento_Customer::account/customer.phtml" before="-"/>
<block class="MagentoCustomerBlockAccountAuthorizationLink" name="authorization-link-login" template="Magento_Customer::account/link/authorization.phtml">
</block>
</referenceBlock>

<move element="top.links" destination="customer"/>
</body>
</page>


Vendor/Theme/Magento_Customer/templates/account/customer.phtml



<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile
/** @var MagentoCustomerBlockAccountCustomer $block */
?>
<?php if($block->customerLoggedIn()): ?>
<li class="customer-welcome">
<span class="customer-name"
role="link"
tabindex="0"
data-mage-init='"dropdown":'
data-toggle="dropdown"
data-trigger-keypress-button="true"
data-bind="scope: 'customer'">
<span data-bind="text: customer().fullname"></span>
<button type="button"
class="action switch"
tabindex="-1"
data-action="customer-menu-toggle">
<span><?= $block->escapeHtml(__('Change')) ?></span>
</button>
</span>
<script type="text/x-magento-init">

"*":
"Magento_Ui/js/core/app":
"components":
"customer":
"component": "Magento_Customer/js/view/customer"





</script>
<?php if($block->getChildHtml()):?>
<div class="customer-menu" data-target="dropdown">
<?= $block->getChildHtml() ?>
</div>
<?php endif; ?>
</li>
<?php endif; ?>


Here, when user is not logged in, I can see Sign In link but after user logs in I can see sign-out in user account dropdown on header as well as besides it. How do I resolve this?










share|improve this question
























  • have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…

    – fogx
    Mar 29 '18 at 15:21













3












3








3


2






After successful login, Luma theme shows customer account details in dropdown on header as seen in below image



enter image description here



I need to replicate the same in our custom theme which has Blank as its parent.



Vendor/Theme/Magento_Theme/layout/default.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="header.panel">
<block class="MagentoFrameworkViewElementHtmlLinks" name="header.links">
<arguments>
<argument name="css_class" xsi:type="string">header links</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>


Vendor/Theme/Magento_Customer/layout/default.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>
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountCustomer" name="customer" template="Magento_Customer::account/customer.phtml" before="-"/>
<block class="MagentoCustomerBlockAccountAuthorizationLink" name="authorization-link-login" template="Magento_Customer::account/link/authorization.phtml">
</block>
</referenceBlock>

<move element="top.links" destination="customer"/>
</body>
</page>


Vendor/Theme/Magento_Customer/templates/account/customer.phtml



<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile
/** @var MagentoCustomerBlockAccountCustomer $block */
?>
<?php if($block->customerLoggedIn()): ?>
<li class="customer-welcome">
<span class="customer-name"
role="link"
tabindex="0"
data-mage-init='"dropdown":'
data-toggle="dropdown"
data-trigger-keypress-button="true"
data-bind="scope: 'customer'">
<span data-bind="text: customer().fullname"></span>
<button type="button"
class="action switch"
tabindex="-1"
data-action="customer-menu-toggle">
<span><?= $block->escapeHtml(__('Change')) ?></span>
</button>
</span>
<script type="text/x-magento-init">

"*":
"Magento_Ui/js/core/app":
"components":
"customer":
"component": "Magento_Customer/js/view/customer"





</script>
<?php if($block->getChildHtml()):?>
<div class="customer-menu" data-target="dropdown">
<?= $block->getChildHtml() ?>
</div>
<?php endif; ?>
</li>
<?php endif; ?>


Here, when user is not logged in, I can see Sign In link but after user logs in I can see sign-out in user account dropdown on header as well as besides it. How do I resolve this?










share|improve this question
















After successful login, Luma theme shows customer account details in dropdown on header as seen in below image



enter image description here



I need to replicate the same in our custom theme which has Blank as its parent.



Vendor/Theme/Magento_Theme/layout/default.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="header.panel">
<block class="MagentoFrameworkViewElementHtmlLinks" name="header.links">
<arguments>
<argument name="css_class" xsi:type="string">header links</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>


Vendor/Theme/Magento_Customer/layout/default.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>
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountCustomer" name="customer" template="Magento_Customer::account/customer.phtml" before="-"/>
<block class="MagentoCustomerBlockAccountAuthorizationLink" name="authorization-link-login" template="Magento_Customer::account/link/authorization.phtml">
</block>
</referenceBlock>

<move element="top.links" destination="customer"/>
</body>
</page>


Vendor/Theme/Magento_Customer/templates/account/customer.phtml



<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile
/** @var MagentoCustomerBlockAccountCustomer $block */
?>
<?php if($block->customerLoggedIn()): ?>
<li class="customer-welcome">
<span class="customer-name"
role="link"
tabindex="0"
data-mage-init='"dropdown":'
data-toggle="dropdown"
data-trigger-keypress-button="true"
data-bind="scope: 'customer'">
<span data-bind="text: customer().fullname"></span>
<button type="button"
class="action switch"
tabindex="-1"
data-action="customer-menu-toggle">
<span><?= $block->escapeHtml(__('Change')) ?></span>
</button>
</span>
<script type="text/x-magento-init">

"*":
"Magento_Ui/js/core/app":
"components":
"customer":
"component": "Magento_Customer/js/view/customer"





</script>
<?php if($block->getChildHtml()):?>
<div class="customer-menu" data-target="dropdown">
<?= $block->getChildHtml() ?>
</div>
<?php endif; ?>
</li>
<?php endif; ?>


Here, when user is not logged in, I can see Sign In link but after user logs in I can see sign-out in user account dropdown on header as well as besides it. How do I resolve this?







magento2 layout customer xml custom-theme






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 8 '18 at 10:44







Slimshadddyyy

















asked Feb 8 '18 at 7:25









SlimshadddyyySlimshadddyyy

61511547




61511547












  • have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…

    – fogx
    Mar 29 '18 at 15:21

















  • have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…

    – fogx
    Mar 29 '18 at 15:21
















have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…

– fogx
Mar 29 '18 at 15:21





have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…

– fogx
Mar 29 '18 at 15:21










1 Answer
1






active

oldest

votes


















0














Add this to your css file:



.header.panel>.header.links>.customer-welcome+.authorization-link
display: none;





share























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f212665%2fmagento-2-2-2-display-customer-account-header-dropdown-and-remove-sign-out-lin%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Add this to your css file:



    .header.panel>.header.links>.customer-welcome+.authorization-link
    display: none;





    share



























      0














      Add this to your css file:



      .header.panel>.header.links>.customer-welcome+.authorization-link
      display: none;





      share

























        0












        0








        0







        Add this to your css file:



        .header.panel>.header.links>.customer-welcome+.authorization-link
        display: none;





        share













        Add this to your css file:



        .header.panel>.header.links>.customer-welcome+.authorization-link
        display: none;






        share











        share


        share










        answered 3 mins ago









        Frank007Frank007

        163




        163



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f212665%2fmagento-2-2-2-display-customer-account-header-dropdown-and-remove-sign-out-lin%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

            Magento 2 disable Secret Key on URL's from terminal The Next CEO of Stack OverflowMagento 2 Shortcut/GUI tool to perform commandline tasks for windowsIn menu add configuration linkMagento oAuth : Generating access token and access secretMagento 2 security key issue in Third-Party API redirect URIPublic actions in admin controllersHow to Disable Cache in Custom WidgetURL Key not changing in Magento 2Product URL Key gets deleted when importing custom options - Magento 2Problem with reindex terminalMagento 2 - bin/magento Commands not working in Cpanel Terminal

            Aasi (pallopeli) Navigointivalikko