Breadcrumbs not showing the home and category namesRemoving 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
Why is this clock signal connected to a capacitor to gnd?
Can the Meissner effect explain very large floating structures?
iPad being using in wall mount battery swollen
Avoiding the "not like other girls" trope?
Can we compute the area of a quadrilateral with one right angle when we only know the lengths of any three sides?
Expand and Contract
Forgetting the musical notes while performing in concert
How to show a landlord what we have in savings?
How seriously should I take size and weight limits of hand luggage?
ssTTsSTtRrriinInnnnNNNIiinngg
Can compressed videos be decoded back to their uncompresed original format?
Determining Impedance With An Antenna Analyzer
Do scales need to be in alphabetical order?
Would Slavery Reparations be considered Bills of Attainder and hence Illegal?
Examples of smooth manifolds admitting inbetween one and a continuum of complex structures
Why can't we play rap on piano?
Venezuelan girlfriend wants to travel the USA to be with me. What is the process?
What do you call someone who asks many questions?
How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?
Why was the shrinking from 8″ made only to 5.25″ and not smaller (4″ or less)?
Assassin's bullet with mercury
Valid term from quadratic sequence?
How do I deal with an unproductive colleague in a small company?
If human space travel is limited by the G force vulnerability, is there a way to counter G forces?
Breadcrumbs not showing the home and category names
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
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 2 days ago
ABHISHEK TRIPATHI
2,0611728
2,0611728
asked 2 days ago
JaisaJaisa
8891938
8891938
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
2 days ago
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
2 days ago
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
2 days ago
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 2 days ago
Mano MMano M
1,023219
1,023219
Thank you @Mano,works fine
– Jaisa
2 days ago
add a comment |
Thank you @Mano,works fine
– Jaisa
2 days ago
Thank you @Mano,works fine
– Jaisa
2 days ago
Thank you @Mano,works fine
– Jaisa
2 days ago
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