The top.links block addLink used to add links to this block. When you look at the body of this method, you will see that the position parameter is used to determine the position of the links.
The link position is determined by this piece of code:
$this->_links[$this->_getNewPosition($position)] = $link; if (intval($position) > 0) { ksort($this->_links); }
_getNewPosition() method checks whether this particular position is available. If this is not the case, then he will look for the nearest available one (i.e., in position 1 there can be only one link). After receiving the correct link position, the entire array of links is sorted.
In your case, the position of both the login and the logout is set to 100 by default (see the <position /> ). So, copy the xml layout ( customer.xml ) into the theme layout directory and change the position parameters to 1.
If these links do not appear in position 1, it means that some other link had a position set to 1 in front of yours. In this case, simply change the position of this link to a larger number. Please note that you cannot use position values ββless than or equal to zero.
source share