Breadcrumbs not showing the home and category names Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Removing home and all Categories from breadcrumbsExclude a specific category from breadcrumbsBreadcrumbs are not appearing because they are nullChange Breadcrumbs Home link's URL 2.1Hide breadcrumbs on specific category page in magento2Breadcrumbs not working on Product Page Magento 2.2.4Magento 2 : How to remove part of the breadcrumbs in category product page?Breadcrumbs not displaying on Product Page Magento-2.2.4How to add breadcrumbs on Category and product detailsAdd Category to breadcrumbs Magento 2
How would a mousetrap for use in space work?
What does "lightly crushed" mean for cardamon pods?
2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?
Why do we bend a book to keep it straight?
When the Haste spell ends on a creature, do attackers have advantage against that creature?
Why are the trig functions versine, haversine, exsecant, etc, rarely used in modern mathematics?
If my PI received research grants from a company to be able to pay my postdoc salary, did I have a potential conflict interest too?
What would be the ideal power source for a cybernetic eye?
Crossing US/Canada Border for less than 24 hours
8 Prisoners wearing hats
How could we fake a moon landing now?
Would "destroying" Wurmcoil Engine prevent its tokens from being created?
Can melee weapons be used to deliver Contact Poisons?
What is the escape velocity of a neutron particle (not neutron star)
Does classifying an integer as a discrete log require it be part of a multiplicative group?
Most bit efficient text communication method?
Irreducible of finite Krull dimension implies quasi-compact?
Can an alien society believe that their star system is the universe?
Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?
Is it cost-effective to upgrade an old-ish Giant Escape R3 commuter bike with entry-level branded parts (wheels, drivetrain)?
Quick way to create a symlink?
Generate an RGB colour grid
What is the meaning of the simile “quick as silk”?
Why aren't air breathing engines used as small first stages
Breadcrumbs not showing the home and category names
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Removing home and all Categories from breadcrumbsExclude a specific category from breadcrumbsBreadcrumbs are not appearing because they are nullChange Breadcrumbs Home link's URL 2.1Hide breadcrumbs on specific category page in magento2Breadcrumbs not working on Product Page Magento 2.2.4Magento 2 : How to remove part of the breadcrumbs in category product page?Breadcrumbs not displaying on Product Page Magento-2.2.4How to add breadcrumbs on Category and product detailsAdd Category to breadcrumbs Magento 2
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Breadcrumbs is not showing the home ,category names in product details page.
It shows Only Product name. How do I resolve it,Please provide me a solution
magento2.2.6 product-page breadcrumbs
add a comment |
Breadcrumbs is not showing the home ,category names in product details page.
It shows Only Product name. How do I resolve it,Please provide me a solution
magento2.2.6 product-page breadcrumbs
add a comment |
Breadcrumbs is not showing the home ,category names in product details page.
It shows Only Product name. How do I resolve it,Please provide me a solution
magento2.2.6 product-page breadcrumbs
Breadcrumbs is not showing the home ,category names in product details page.
It shows Only Product name. How do I resolve it,Please provide me a solution
magento2.2.6 product-page breadcrumbs
magento2.2.6 product-page breadcrumbs
edited Apr 1 at 9:44
ABHISHEK TRIPATHI
2,1741828
2,1741828
asked Apr 1 at 9:40
JaisaJaisa
9061939
9061939
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
In catalog_product_view.xml
<?xml version="1.0"?>
<page>
<body>
<referenceBlock name="breadcrumbs" remove="true" />
<referenceContainer name="page.top">
<block class="XXXBreadcrumbsBlockBreadcrumbs" name="product.view.breadcrumbs" template="XXX_Breadcrumbs::breadcrumbs.phtml" />
</referenceContainer>
</body>
</page>
In breadcrumbs.phtml:
<?php $crumbs = $block->getBreadcrumb(); ?>
<?php if ($crumbs && is_array($crumbs)) : ?>
<div class="breadcrumbs">
<ul class="items">
<?php foreach ($crumbs as $crumbName => $crumbInfo) : ?>
<li class="item <?= /* @escapeNotVerified */ $crumbName ?>">
<?php if ($crumbInfo['link']) : ?>
<a href="<?= /* @escapeNotVerified */ $crumbInfo['link'] ?>" title="<?= $block->escapeHtml($crumbInfo['title']) ?>"><?= $block->escapeHtml($crumbInfo['label']) ?></a>
<?php else: ?>
<?= $block->escapeHtml($crumbInfo['label']) ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
In Breadcrumbs.php:
<?php
namespace XXXBreadcrumbsBlock;
use MagentoCatalogHelperData;
use MagentoFrameworkViewElementTemplateContext;
class Breadcrumbs extends MagentoThemeBlockHtmlBreadcrumbs
/**
* Catalog data
*
* @var Data
*/
protected $_catalogData = null;
protected $path = array();
/**
* @param Context $context
* @param Data $catalogData
* @param array $data
*/
public function __construct(Context $context, Data $catalogData, array $data = [])
$this->_catalogData = $catalogData;
parent::__construct($context, $data);
public function getTitleSeparator($store = null)
$separator = (string) $this->_scopeConfig->getValue('catalog/seo/title_separator', MagentoStoreModelScopeInterface::SCOPE_STORE, $store);
return ' ' . $separator . ' ';
public function getBreadcrumb()
$this->addCrumb(
'home', [
'label' => __('Home'),
'title' => __('Go to Home Page'),
'link' => $this->getBaseUrl()
]
);
foreach ((array) $this->path as $name => $breadcrumb)
$this->addCrumb($name, $breadcrumb);
return $this->getCrumbs();
protected function _prepareLayout()
$this->path = $this->_catalogData->getBreadcrumbPath();
$title = [];
foreach ((array) $this->path as $name => $breadcrumb)
$title[] = $breadcrumb['label'];
$this->pageConfig->getTitle()->set(join($this->getTitleSeparator(), array_reverse($title)));
return parent::_prepareLayout();
public function getCrumbs()
return $this->_crumbs;
public function getBaseUrl()
return $this->_storeManager->getStore()->getBaseUrl();
If you got it, let me know.
Thank you @Mano,works fine
– Jaisa
Apr 1 at 13:15
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268162%2fbreadcrumbs-not-showing-the-home-and-category-names%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In catalog_product_view.xml
<?xml version="1.0"?>
<page>
<body>
<referenceBlock name="breadcrumbs" remove="true" />
<referenceContainer name="page.top">
<block class="XXXBreadcrumbsBlockBreadcrumbs" name="product.view.breadcrumbs" template="XXX_Breadcrumbs::breadcrumbs.phtml" />
</referenceContainer>
</body>
</page>
In breadcrumbs.phtml:
<?php $crumbs = $block->getBreadcrumb(); ?>
<?php if ($crumbs && is_array($crumbs)) : ?>
<div class="breadcrumbs">
<ul class="items">
<?php foreach ($crumbs as $crumbName => $crumbInfo) : ?>
<li class="item <?= /* @escapeNotVerified */ $crumbName ?>">
<?php if ($crumbInfo['link']) : ?>
<a href="<?= /* @escapeNotVerified */ $crumbInfo['link'] ?>" title="<?= $block->escapeHtml($crumbInfo['title']) ?>"><?= $block->escapeHtml($crumbInfo['label']) ?></a>
<?php else: ?>
<?= $block->escapeHtml($crumbInfo['label']) ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
In Breadcrumbs.php:
<?php
namespace XXXBreadcrumbsBlock;
use MagentoCatalogHelperData;
use MagentoFrameworkViewElementTemplateContext;
class Breadcrumbs extends MagentoThemeBlockHtmlBreadcrumbs
/**
* Catalog data
*
* @var Data
*/
protected $_catalogData = null;
protected $path = array();
/**
* @param Context $context
* @param Data $catalogData
* @param array $data
*/
public function __construct(Context $context, Data $catalogData, array $data = [])
$this->_catalogData = $catalogData;
parent::__construct($context, $data);
public function getTitleSeparator($store = null)
$separator = (string) $this->_scopeConfig->getValue('catalog/seo/title_separator', MagentoStoreModelScopeInterface::SCOPE_STORE, $store);
return ' ' . $separator . ' ';
public function getBreadcrumb()
$this->addCrumb(
'home', [
'label' => __('Home'),
'title' => __('Go to Home Page'),
'link' => $this->getBaseUrl()
]
);
foreach ((array) $this->path as $name => $breadcrumb)
$this->addCrumb($name, $breadcrumb);
return $this->getCrumbs();
protected function _prepareLayout()
$this->path = $this->_catalogData->getBreadcrumbPath();
$title = [];
foreach ((array) $this->path as $name => $breadcrumb)
$title[] = $breadcrumb['label'];
$this->pageConfig->getTitle()->set(join($this->getTitleSeparator(), array_reverse($title)));
return parent::_prepareLayout();
public function getCrumbs()
return $this->_crumbs;
public function getBaseUrl()
return $this->_storeManager->getStore()->getBaseUrl();
If you got it, let me know.
Thank you @Mano,works fine
– Jaisa
Apr 1 at 13:15
add a comment |
In catalog_product_view.xml
<?xml version="1.0"?>
<page>
<body>
<referenceBlock name="breadcrumbs" remove="true" />
<referenceContainer name="page.top">
<block class="XXXBreadcrumbsBlockBreadcrumbs" name="product.view.breadcrumbs" template="XXX_Breadcrumbs::breadcrumbs.phtml" />
</referenceContainer>
</body>
</page>
In breadcrumbs.phtml:
<?php $crumbs = $block->getBreadcrumb(); ?>
<?php if ($crumbs && is_array($crumbs)) : ?>
<div class="breadcrumbs">
<ul class="items">
<?php foreach ($crumbs as $crumbName => $crumbInfo) : ?>
<li class="item <?= /* @escapeNotVerified */ $crumbName ?>">
<?php if ($crumbInfo['link']) : ?>
<a href="<?= /* @escapeNotVerified */ $crumbInfo['link'] ?>" title="<?= $block->escapeHtml($crumbInfo['title']) ?>"><?= $block->escapeHtml($crumbInfo['label']) ?></a>
<?php else: ?>
<?= $block->escapeHtml($crumbInfo['label']) ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
In Breadcrumbs.php:
<?php
namespace XXXBreadcrumbsBlock;
use MagentoCatalogHelperData;
use MagentoFrameworkViewElementTemplateContext;
class Breadcrumbs extends MagentoThemeBlockHtmlBreadcrumbs
/**
* Catalog data
*
* @var Data
*/
protected $_catalogData = null;
protected $path = array();
/**
* @param Context $context
* @param Data $catalogData
* @param array $data
*/
public function __construct(Context $context, Data $catalogData, array $data = [])
$this->_catalogData = $catalogData;
parent::__construct($context, $data);
public function getTitleSeparator($store = null)
$separator = (string) $this->_scopeConfig->getValue('catalog/seo/title_separator', MagentoStoreModelScopeInterface::SCOPE_STORE, $store);
return ' ' . $separator . ' ';
public function getBreadcrumb()
$this->addCrumb(
'home', [
'label' => __('Home'),
'title' => __('Go to Home Page'),
'link' => $this->getBaseUrl()
]
);
foreach ((array) $this->path as $name => $breadcrumb)
$this->addCrumb($name, $breadcrumb);
return $this->getCrumbs();
protected function _prepareLayout()
$this->path = $this->_catalogData->getBreadcrumbPath();
$title = [];
foreach ((array) $this->path as $name => $breadcrumb)
$title[] = $breadcrumb['label'];
$this->pageConfig->getTitle()->set(join($this->getTitleSeparator(), array_reverse($title)));
return parent::_prepareLayout();
public function getCrumbs()
return $this->_crumbs;
public function getBaseUrl()
return $this->_storeManager->getStore()->getBaseUrl();
If you got it, let me know.
Thank you @Mano,works fine
– Jaisa
Apr 1 at 13:15
add a comment |
In catalog_product_view.xml
<?xml version="1.0"?>
<page>
<body>
<referenceBlock name="breadcrumbs" remove="true" />
<referenceContainer name="page.top">
<block class="XXXBreadcrumbsBlockBreadcrumbs" name="product.view.breadcrumbs" template="XXX_Breadcrumbs::breadcrumbs.phtml" />
</referenceContainer>
</body>
</page>
In breadcrumbs.phtml:
<?php $crumbs = $block->getBreadcrumb(); ?>
<?php if ($crumbs && is_array($crumbs)) : ?>
<div class="breadcrumbs">
<ul class="items">
<?php foreach ($crumbs as $crumbName => $crumbInfo) : ?>
<li class="item <?= /* @escapeNotVerified */ $crumbName ?>">
<?php if ($crumbInfo['link']) : ?>
<a href="<?= /* @escapeNotVerified */ $crumbInfo['link'] ?>" title="<?= $block->escapeHtml($crumbInfo['title']) ?>"><?= $block->escapeHtml($crumbInfo['label']) ?></a>
<?php else: ?>
<?= $block->escapeHtml($crumbInfo['label']) ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
In Breadcrumbs.php:
<?php
namespace XXXBreadcrumbsBlock;
use MagentoCatalogHelperData;
use MagentoFrameworkViewElementTemplateContext;
class Breadcrumbs extends MagentoThemeBlockHtmlBreadcrumbs
/**
* Catalog data
*
* @var Data
*/
protected $_catalogData = null;
protected $path = array();
/**
* @param Context $context
* @param Data $catalogData
* @param array $data
*/
public function __construct(Context $context, Data $catalogData, array $data = [])
$this->_catalogData = $catalogData;
parent::__construct($context, $data);
public function getTitleSeparator($store = null)
$separator = (string) $this->_scopeConfig->getValue('catalog/seo/title_separator', MagentoStoreModelScopeInterface::SCOPE_STORE, $store);
return ' ' . $separator . ' ';
public function getBreadcrumb()
$this->addCrumb(
'home', [
'label' => __('Home'),
'title' => __('Go to Home Page'),
'link' => $this->getBaseUrl()
]
);
foreach ((array) $this->path as $name => $breadcrumb)
$this->addCrumb($name, $breadcrumb);
return $this->getCrumbs();
protected function _prepareLayout()
$this->path = $this->_catalogData->getBreadcrumbPath();
$title = [];
foreach ((array) $this->path as $name => $breadcrumb)
$title[] = $breadcrumb['label'];
$this->pageConfig->getTitle()->set(join($this->getTitleSeparator(), array_reverse($title)));
return parent::_prepareLayout();
public function getCrumbs()
return $this->_crumbs;
public function getBaseUrl()
return $this->_storeManager->getStore()->getBaseUrl();
If you got it, let me know.
In catalog_product_view.xml
<?xml version="1.0"?>
<page>
<body>
<referenceBlock name="breadcrumbs" remove="true" />
<referenceContainer name="page.top">
<block class="XXXBreadcrumbsBlockBreadcrumbs" name="product.view.breadcrumbs" template="XXX_Breadcrumbs::breadcrumbs.phtml" />
</referenceContainer>
</body>
</page>
In breadcrumbs.phtml:
<?php $crumbs = $block->getBreadcrumb(); ?>
<?php if ($crumbs && is_array($crumbs)) : ?>
<div class="breadcrumbs">
<ul class="items">
<?php foreach ($crumbs as $crumbName => $crumbInfo) : ?>
<li class="item <?= /* @escapeNotVerified */ $crumbName ?>">
<?php if ($crumbInfo['link']) : ?>
<a href="<?= /* @escapeNotVerified */ $crumbInfo['link'] ?>" title="<?= $block->escapeHtml($crumbInfo['title']) ?>"><?= $block->escapeHtml($crumbInfo['label']) ?></a>
<?php else: ?>
<?= $block->escapeHtml($crumbInfo['label']) ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
In Breadcrumbs.php:
<?php
namespace XXXBreadcrumbsBlock;
use MagentoCatalogHelperData;
use MagentoFrameworkViewElementTemplateContext;
class Breadcrumbs extends MagentoThemeBlockHtmlBreadcrumbs
/**
* Catalog data
*
* @var Data
*/
protected $_catalogData = null;
protected $path = array();
/**
* @param Context $context
* @param Data $catalogData
* @param array $data
*/
public function __construct(Context $context, Data $catalogData, array $data = [])
$this->_catalogData = $catalogData;
parent::__construct($context, $data);
public function getTitleSeparator($store = null)
$separator = (string) $this->_scopeConfig->getValue('catalog/seo/title_separator', MagentoStoreModelScopeInterface::SCOPE_STORE, $store);
return ' ' . $separator . ' ';
public function getBreadcrumb()
$this->addCrumb(
'home', [
'label' => __('Home'),
'title' => __('Go to Home Page'),
'link' => $this->getBaseUrl()
]
);
foreach ((array) $this->path as $name => $breadcrumb)
$this->addCrumb($name, $breadcrumb);
return $this->getCrumbs();
protected function _prepareLayout()
$this->path = $this->_catalogData->getBreadcrumbPath();
$title = [];
foreach ((array) $this->path as $name => $breadcrumb)
$title[] = $breadcrumb['label'];
$this->pageConfig->getTitle()->set(join($this->getTitleSeparator(), array_reverse($title)));
return parent::_prepareLayout();
public function getCrumbs()
return $this->_crumbs;
public function getBaseUrl()
return $this->_storeManager->getStore()->getBaseUrl();
If you got it, let me know.
answered Apr 1 at 11:44
Mano MMano M
1,077219
1,077219
Thank you @Mano,works fine
– Jaisa
Apr 1 at 13:15
add a comment |
Thank you @Mano,works fine
– Jaisa
Apr 1 at 13:15
Thank you @Mano,works fine
– Jaisa
Apr 1 at 13:15
Thank you @Mano,works fine
– Jaisa
Apr 1 at 13:15
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268162%2fbreadcrumbs-not-showing-the-home-and-category-names%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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