Magento Asked on December 31, 2020
app/design/frontend/vendorname/themename/Magento_cms/layout/cms_index_index.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="logo">
<arguments>
<argument name="logo_file" xsi:type="string">images/logo-light.png</argument>
</arguments>
</referenceBlock>
</body>
but issue is magento backend side configuration add logo-light.png but cms page logo not visible
transpart logo visible
please thanks advance for help
Default.phtml file
<div class="header-left offset-md-4 col-md-4">
<div class="logo-wrapper <?php echo $logo?"sticky-item":"sticky-item-hidden" ?>">
<?php echo $this->getChildHtml('logo') ?>
<a href=""><img class="logo-light" src="<?php echo $mediaUrl.'wysiwyg/logo-light.png'; ?>" /></a>
</div>
</div>
_extend.less
.home-page-transparent-header {
.page-header {
a.logo {
img {
display: none;
}
}
&.navbar-fixed-top.keep-header {
.header-left {
margin: 0;
}
.logo-light {
display: none;
}
a.logo {
img {
display: block;
}
}
}
}
}
Answered by Ravindrasinh Zala on December 31, 2020
Default.phtml file
<?php
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$storeManager = $objectManager-
>get('MagentoStoreModelStoreManagerInterface');
$currentStore = $storeManager->getStore();
$mediaUrl = $currentStore-
>getBaseUrl(MagentoFrameworkUrlInterface::URL_TYPE_MEDIA);
$request = $objectManager->get('MagentoFrameworkAppActionContext')-
>getRequest();
//var_dump($request->getFullActionName());
?>
<div class="header-left offset-md-4 col-md-4">
<?php if ($request->getFullActionName() == 'cms_index_index'): ?>
<div class="logo-wrapper <?php echo $logo?"sticky-item":"sticky-item-hidden" ?>">
<?php echo $this->getChildHtml('logo') ?>
</div>
<?php else: ?>
<div class="logo-wrapper <?php echo $logo?"sticky-item":"sticky-item-hidden" ?>">
<img src="<?php echo $mediaUrl.'wysiwyg/logo-dark.jpg'; ?>" />
</div>
<?php endif; ?>
</div>
Answered by Ravindrasinh Zala on December 31, 2020
If your image is not in SVG then just upload your image from admin panel
"Content > Configuration > Select Your Current Theme [edit] > Header > Logo Image"
Thanks
Answered by Nilesh Dubey on December 31, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP