Magento 2 : Remove Top Links When Customer Not Logged InRemove Specific Top LinksTop links only show all when customer is logged inChange Top Links Text after LoginChanging the link location in top linksHow to hide top links from customer groupsTop links when login or not loginMagento 2 remove My Account and Wishlist link from top linksMagento2: how to add remove header links conditionallyHow to Add/Remove Top Links for logged-in/logged-out Users in Magento 2.1Remove My Account top bar when user is not logged in

Has anyone in space seen or photographed a simple laser pointer from Earth?

Using Newton's shell theorem to accelerate a spaceship

Why isn't pressure filtration popular compared to vacuum filtration?

How to memorize multiple pieces?

Should disabled buttons give feedback when clicked?

If a non-friend comes across my Steam Wishlist, how easily can he gift me one of the games?

How would my creatures handle groups without a strong concept of numbers?

Why can a destructor change the state of a constant object?

Confirming the Identity of a (Friendly) Reviewer After the Reviews

What steps should I take to lawfully visit the United States as a tourist immediately after visiting on a B-1 visa?

Why are Hobbits so fond of mushrooms?

Are neural networks prone to catastrophic forgetting?

QGIS Zanzibar how to crop?

For a hashing function like MD5, how similar can two plaintext strings be and still generate the same hash?

Why queuable apex accepts sobjects where as future methods doesn't?

Is there a way to know which symbolic expression mathematica used

How to ask for a LinkedIn endorsement?

Why was hardware diversification an asset for the IBM PC ecosystem?

How to tell someone I'd like to become friends without letting them think I'm romantically interested in them?

How can I calculate the sum of 2 random dice out of a 3d6 pool in AnyDice?

What is a solution?

Was I subtly told to resign?

Do you know your 'KVZ's?

Can fluent English speakers distinguish “steel”, “still” and “steal”?



Magento 2 : Remove Top Links When Customer Not Logged In


Remove Specific Top LinksTop links only show all when customer is logged inChange Top Links Text after LoginChanging the link location in top linksHow to hide top links from customer groupsTop links when login or not loginMagento 2 remove My Account and Wishlist link from top linksMagento2: how to add remove header links conditionallyHow to Add/Remove Top Links for logged-in/logged-out Users in Magento 2.1Remove My Account top bar when user is not logged in






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I would like to remove My Account link from top links, when customer is not logged in.



How do I achieve it via XML layout files?










share|improve this question






























    2















    I would like to remove My Account link from top links, when customer is not logged in.



    How do I achieve it via XML layout files?










    share|improve this question


























      2












      2








      2


      0






      I would like to remove My Account link from top links, when customer is not logged in.



      How do I achieve it via XML layout files?










      share|improve this question
















      I would like to remove My Account link from top links, when customer is not logged in.



      How do I achieve it via XML layout files?







      magento2 layout customer toplinks link






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 8 '17 at 5:52









      Khoa TruongDinh

      23k6 gold badges45 silver badges92 bronze badges




      23k6 gold badges45 silver badges92 bronze badges










      asked Feb 7 '17 at 22:26









      gianis6gianis6

      73514 silver badges36 bronze badges




      73514 silver badges36 bronze badges




















          2 Answers
          2






          active

          oldest

          votes


















          0














          You can do it without xml file also which will be easier for your task.
          First step that you have to do is override header part and once its done apply some simple logic like by checking cx is logged in or not.



          $objectManager = MagentoFrameworkAppObjectManager::getInstance();
          $customerSession = $objectManager->get('MagentoCustomerModelSession');

          if($customerSession->isLoggedIn()) //apply logic here





          share|improve this answer






























            0














            You can remove via overriding theme layout or xml file.




            app/design/frontend/Package/themename/Magento_Customer/layout/default.xml




            <referenceBlock name="top.links">
            <referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
            <referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
            </referenceBlock>


            I hope this will help you






            share|improve this answer























            • This will always remove My Account link, I need to remove it only when the customer is logged out

              – gianis6
              Feb 8 '17 at 9:49











            • I need to display My Account link only for logged in customer

              – gianis6
              Feb 8 '17 at 9:53













            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%2f158641%2fmagento-2-remove-top-links-when-customer-not-logged-in%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You can do it without xml file also which will be easier for your task.
            First step that you have to do is override header part and once its done apply some simple logic like by checking cx is logged in or not.



            $objectManager = MagentoFrameworkAppObjectManager::getInstance();
            $customerSession = $objectManager->get('MagentoCustomerModelSession');

            if($customerSession->isLoggedIn()) //apply logic here





            share|improve this answer



























              0














              You can do it without xml file also which will be easier for your task.
              First step that you have to do is override header part and once its done apply some simple logic like by checking cx is logged in or not.



              $objectManager = MagentoFrameworkAppObjectManager::getInstance();
              $customerSession = $objectManager->get('MagentoCustomerModelSession');

              if($customerSession->isLoggedIn()) //apply logic here





              share|improve this answer

























                0












                0








                0







                You can do it without xml file also which will be easier for your task.
                First step that you have to do is override header part and once its done apply some simple logic like by checking cx is logged in or not.



                $objectManager = MagentoFrameworkAppObjectManager::getInstance();
                $customerSession = $objectManager->get('MagentoCustomerModelSession');

                if($customerSession->isLoggedIn()) //apply logic here





                share|improve this answer













                You can do it without xml file also which will be easier for your task.
                First step that you have to do is override header part and once its done apply some simple logic like by checking cx is logged in or not.



                $objectManager = MagentoFrameworkAppObjectManager::getInstance();
                $customerSession = $objectManager->get('MagentoCustomerModelSession');

                if($customerSession->isLoggedIn()) //apply logic here






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 8 '17 at 5:06









                Faisal KazmiFaisal Kazmi

                215 bronze badges




                215 bronze badges























                    0














                    You can remove via overriding theme layout or xml file.




                    app/design/frontend/Package/themename/Magento_Customer/layout/default.xml




                    <referenceBlock name="top.links">
                    <referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
                    <referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
                    </referenceBlock>


                    I hope this will help you






                    share|improve this answer























                    • This will always remove My Account link, I need to remove it only when the customer is logged out

                      – gianis6
                      Feb 8 '17 at 9:49











                    • I need to display My Account link only for logged in customer

                      – gianis6
                      Feb 8 '17 at 9:53















                    0














                    You can remove via overriding theme layout or xml file.




                    app/design/frontend/Package/themename/Magento_Customer/layout/default.xml




                    <referenceBlock name="top.links">
                    <referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
                    <referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
                    </referenceBlock>


                    I hope this will help you






                    share|improve this answer























                    • This will always remove My Account link, I need to remove it only when the customer is logged out

                      – gianis6
                      Feb 8 '17 at 9:49











                    • I need to display My Account link only for logged in customer

                      – gianis6
                      Feb 8 '17 at 9:53













                    0












                    0








                    0







                    You can remove via overriding theme layout or xml file.




                    app/design/frontend/Package/themename/Magento_Customer/layout/default.xml




                    <referenceBlock name="top.links">
                    <referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
                    <referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
                    </referenceBlock>


                    I hope this will help you






                    share|improve this answer













                    You can remove via overriding theme layout or xml file.




                    app/design/frontend/Package/themename/Magento_Customer/layout/default.xml




                    <referenceBlock name="top.links">
                    <referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
                    <referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
                    </referenceBlock>


                    I hope this will help you







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 8 '17 at 9:35









                    NitsNits

                    1,2694 silver badges17 bronze badges




                    1,2694 silver badges17 bronze badges












                    • This will always remove My Account link, I need to remove it only when the customer is logged out

                      – gianis6
                      Feb 8 '17 at 9:49











                    • I need to display My Account link only for logged in customer

                      – gianis6
                      Feb 8 '17 at 9:53

















                    • This will always remove My Account link, I need to remove it only when the customer is logged out

                      – gianis6
                      Feb 8 '17 at 9:49











                    • I need to display My Account link only for logged in customer

                      – gianis6
                      Feb 8 '17 at 9:53
















                    This will always remove My Account link, I need to remove it only when the customer is logged out

                    – gianis6
                    Feb 8 '17 at 9:49





                    This will always remove My Account link, I need to remove it only when the customer is logged out

                    – gianis6
                    Feb 8 '17 at 9:49













                    I need to display My Account link only for logged in customer

                    – gianis6
                    Feb 8 '17 at 9:53





                    I need to display My Account link only for logged in customer

                    – gianis6
                    Feb 8 '17 at 9:53

















                    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%2f158641%2fmagento-2-remove-top-links-when-customer-not-logged-in%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

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How 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?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form