When i flush the cache the navigation menu disappears. I can get it back by changing the theme and then changing it back.

This is added to default.xml within Magento_Theme/layout folder of my custom theme.

    <referenceBlock name="store.menu">
        <block class="Ves\Megamenu\Block\Menu" name="catalog.topnav" template="Ves_Megamenu::topmenu.phtml" cacheable="true">
                <argument name="alias" xsi:type="string">menu-top</argument>
                <argument name="cacheable" xsi:type="string">true</argument>

This is a custom menu but seemed to work perfectly until recently. Initially it stopped when adding varnish until i removed the ttl attribute and then worked fine. Now however it's having this new strange behavior and am unsure when it started or how to debug at the moment.

  • Tony Brown has spoke about this before and it was related to edge side includes with Varnish. I don't know much about it so maybe this article will help - tonegolf71.com/… – Ben Crook Dec 7 '17 at 15:05
  • @BenCrook Nice little article that but ive taken a first step of disabling varnish now and still issue persists. adding the block to a different block e.g. header.panel it renders fine hmmmmm – harri Dec 7 '17 at 15:46
  • For the sake of debugging what happens if you add `cacheable="false" to the block? Do not commit this change though as it will stop the whole page from cached. – Ben Crook Dec 7 '17 at 16:05
  • 1
    To be honest its just started working and i've flushed cache many a time so it seems stable. Worryingly I'm not sure how its fixed maybe moving the block and putting it back caused that but i'm gonna leave it for now. Thanks anyway Ben – harri Dec 7 '17 at 16:38
  • Good old cache problems :P – Ben Crook Dec 7 '17 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.