7

Situation

We have a breadcrumb block on our product details page. With multiple category trees directing users to a single product page, the breadcrumb trail should change depending on the category which made the referral.

In our case, if Full Page Cache (FPC) is disabled -- the Breadcrumbs are dynamic and it works like I described.

With FPC enabled, the breadcrumb gets fixed on the initial non-cached page request.

Question

How would I go about getting the breadcrumb block to be dynamic on the product page? It's perfectly fine if it's being cached on category results pages.

1

2 Answers 2

3

Add below code in etc/cache.xml file in your any module or make small module

<?xml version="1.0" encoding="UTF-8"?> 
<config>
    <placeholders>
        <catalog_breadcrumbs>
            <block>page/html_breadcrumbs</block>
            <name>breadcrumbs</name>
            <placeholder>CONTAINER_BREADCRUMBS</placeholder>
            <container>Enterprise_PageCache_Model_Container_Breadcrumbs</container>
            <cache_lifetime>86400</cache_lifetime>
        </catalog_breadcrumbs>
    </placeholders>
</config>
0

I have shared a solution for the breadcrumbs issue in the below discussion. Please go through it, I was facing the same issue before enabling this configuration.

I found the best and quickest solution by adding a category path to the links using the below configuration.

Store Configurations > Catalog > Catalog > Search Engine Optimization > Use Categories Path for Product URLs

enter image description here

https://magento.stackexchange.com/a/371758/95447

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.