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

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

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?