0

I've created an additional, static navigation that features a few links to important pages on our Magento website. It's a little nasty, but here's how it's coded:

<?php
$currentUrl = Mage::helper('core/url')->getCurrentUrl();
$url = Mage::getSingleton('core/url')->parseUrl($currentUrl);
$path = $url->getPath();
?>
<ul class="full-width-offer-strip">
  <li><a class="button <?php if (strpos($path,'item1') !== false) { echo 'active'; } ?>" href="<?php echo Mage::getBaseUrl(); ?>item1">Item 1</a></li>
  <li><a class="button <?php if (strpos($path,'item2') !== false) { echo 'active'; } ?>" href="<?php echo Mage::getBaseUrl(); ?>item2">Item 2</a></li>
  <li><a class="button <?php if (strpos($path,'item3') !== false) { echo 'active'; } ?>" href="<?php echo Mage::getBaseUrl(); ?>item3">Item 3</a></li>
</ul>

Every so often I notice that when I'm on one of these pages there's another page also marked with the class active. As soon as I flush the Magento cache it goes away and functions as it should. Is it possible that Magento is caching the static block of another users active page, somehow?

Liam McArthur
  • 1,319
  • 4
  • 20
  • 40
  • are you using any extra caching mechanism like varnish or so ? – liyakat Oct 31 '15 at 12:11
  • We have the basic caching, css/javascript merging enabled in Magento 1.9.1.0. We don't use varnish or any caching plugins - just whatever comes with Magento as standard. – Liam McArthur Oct 31 '15 at 12:35
  • you can use this answer http://magento.stackexchange.com/questions/73538/static-blocks-shown-crazy-in-frontend/73558#73558 i am sure it will worth for you – liyakat Oct 31 '15 at 12:39
  • sometimes its causing this bug https://community.magento.com/t5/Version-Upgrades/Static-blocks-are-mixed-between-store-views-after-upgrading-to-v/td-p/10399 – liyakat Oct 31 '15 at 12:40

0 Answers0