Magento – how does magento generate the content of store link (block name=store.links )in the mobile view

magento2theme

in file /vendor/magento/theme-frontend-blank/Magento_Theme/layout/default.xml, there is a block name store.links nested inside navigation.sections, which is used for the mobile view to show those account links. Can any one tell me how does those links are generated?

I have this question because I wrapped the header.links (account links) into my new block and move it from its original place of header.panel into header-wrapper (the one container the logo and search box originally). After changes, i noticed those links which should show under the navigation.sections ( tab name = Account), are not more showing. Any idea or direction i have to look in? thanks in advance.

Best Answer

here is my answer and hope can be a little help for those who are new to magento2.

//vendor/magento/theme-frontend-blank/web/js/theme.js

there is a line

$('.panel.header > .header.links').clone().appendTo('#store\.links');

if .header.links is moved to block other than .panel.header or even is wrapped in a new div, the above line is required to be updated to. for my case, it should be like

$('.header.content >.star-customer-login-links > .header.links').clone().appendTo('#store\.links');

This is the solution for this issue. but there may be another place have to be updated too. it's

/vendor/magento/theme-frontend-blank/web/js/navigation-menu.js