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













1















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










share|improve this question




























    1















    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










    share|improve this question


























      1












      1








      1


      1






      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










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago









      ABHISHEK TRIPATHI

      2,0611728




      2,0611728










      asked 2 days ago









      JaisaJaisa

      8891938




      8891938




















          1 Answer
          1






          active

          oldest

          votes


















          2














          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.






          share|improve this answer























          • Thank you @Mano,works fine

            – Jaisa
            2 days ago











          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
          );



          );













          draft saved

          draft discarded


















          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









          2














          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.






          share|improve this answer























          • Thank you @Mano,works fine

            – Jaisa
            2 days ago















          2














          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.






          share|improve this answer























          • Thank you @Mano,works fine

            – Jaisa
            2 days ago













          2












          2








          2







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 days ago









          Mano MMano M

          1,023219




          1,023219












          • 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





          Thank you @Mano,works fine

          – Jaisa
          2 days ago

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Bulk add to cart function issuecart vs. mini cart issue … rwd themeRedirect Add to cart button to cart pageAdd to cart issue - Magento 2.1The requested Payment Method is not available When creating an orderM2: reason add-to-cart might not function in production modeAdd to cart issue in some android devicesMagento 2 - custom price can not add to subtotal and grand total after add to cartAdd to cart codeIssue with my cart module on pdp and cart pages, just keeps spinningBulk price and quantity update using rest api

          БиармияSxpst500bh2ntaf! 3h2r