app / design / frontend / Amydus / test / 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.container">
<block class="Magento\Framework\View\Element\Html\Myblock" name="header.myblock">
<arguments>
<argument name="css_class" xsi:type="string">header links</argument>
</arguments>
</block>
</referenceContainer>
<referenceBlock name="top.links">
<block class="Magento\Framework\View\Element\Template" name="tlink.them" before="-" template="Magento_Theme::html/header.phtml"/>
</referenceBlock>
<referenceBlock name="logo">
<arguments>
<argument name="logo_img_width" xsi:type="number">148</argument>
<argument name="logo_img_height" xsi:type="number">43</argument>
</arguments>
</referenceBlock>
<referenceContainer name="footer">
<block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" after="footer_links" template="switch/stores.phtml"/>
</referenceContainer>
<referenceBlock name="report.bugs" remove="true"/>
<move element="copyright" destination="before.body.end"/>
</body>
</page>
app / design / frontend / Amydus / test / Magento_Theme / templates / html / header.phtml
<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$custSession = $objectManager->get('Magento\Customer\Model\Session');
?>
<?php switch ($block->getShowPart()):
case 'welcome': ?>
<!-- <li class="greet welcome" data-bind="scope: 'customer'">
<span data-bind="text: customer().fullname ? $t('Welcome, %1!').replace('%1', customer().fullname) : '<?=$block->escapeHtml($welcomeMessage) ?>'"></span>
</li> -->
<li><a style="margin: 3px 0 0 8px;" href="#"><span>CALL US AT - 9560740007</span></a></li>
<li class=" login_seprator"> | </li>
<li class="easy-return" ><a style="margin: 3px 0 0 8px;" href="#"> <span >EASY RETURNS & EXCHANGE</span></a>
</li>
<li class=" login_seprator"> | </li>
<?php if(!$custSession->isLoggedIn()): ?>
<li class="hi_li"><span class="guest-color">HI GUEST</span></li>
<?php else: ?>
<li class="hi_li"><span><?php echo 'Hi '.$custSession->getCustomer()->getName(); ?></span></li>
<?php endif; ?>
<li class=" login_seprator"> | </li>
<li class="first last top-links-a">
<?php if($custSession->isLoggedIn()): ?>
<a class="" title="Log Out" href="#">LOG OUT</a>
<?php else: ?>
<a class="" title="Log In" href="#">LOGIN</a>
<?php endif; ?>
</li>
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": {
"components": {
"customer": {
"component": "Magento_Customer/js/view/customer"
}
}
}
}
}
</script>
<?php break; ?>
<?php case 'other': ?>
<?php echo $block->getChildHtml(); ?>
<?php break; ?>
<?php endswitch; ?>
magento-2.0
Priyanka Saini
quelle
quelle
<div class="header content"></div>
, wenn Sie diese Links innerhalb des Elements verschieben, in dem sich das Logo befindet? Wie würdest du das machen?Sie können auch die
Magento\Customer\Block\Account\SortLinkInterface
Blockklasse verwenden, mit der Sie Links im Block top.links sortieren können.quelle