Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8536155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:35:50+00:00 2026-06-11T10:35:50+00:00

I have tried the following two methods in catalog/navigation/vert_nav.phtml to add or suppress content

  • 0

I have tried the following two methods in catalog/navigation/vert_nav.phtml to add or suppress content specific to the home page:

if($this->getUrl('') == $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true))):

or

if(
Mage::getSingleton('cms/page')->getIdentifier() == 'home'  &&
Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms' 
) :

Both work fine, however when BLOCK_HTML cache is turned on, it works at first, then after a while the home page starts displaying content that is intended only for other pages (after an else clause I use lower down). When I turn off the BLOCK_HTML, it behaves as expected.

Interestingly I’ve used the same code (the 1st one) in page/html/head.phtml (for home page specific javascript/css), and in page/html/header.phtml (for a header banner that should only appear on the home page), and these work fine even when BLOCK_HTML is ON.

(Magento 1.4.1.1)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:35:52+00:00Added an answer on June 11, 2026 at 10:35 am

    The above answer is the best solution.

    You could simply copy app/code/core/Mage/Catalog/Block/Nagivation.php

    to:

    app/code/local/Mage/Catalog/Block/Nagivation.php

    and then change the getCacheKeyInfo() method as described above.

    /**
     * Get Key pieces for caching block content
     *
     * @return array
     */
    public function getCacheKeyInfo()
    {
        $shortCacheId = array(
            'CATALOG_NAVIGATION',
            Mage::app()->getStore()->getId(),
            Mage::getDesign()->getPackageName(),
            Mage::getDesign()->getTheme('template'),
            Mage::getSingleton('customer/session')->getCustomerGroupId(),
            'template' => $this->getTemplate(),
            'name' => $this->getNameInLayout(),
            $this->getCurrenCategoryKey(),
            // Your logic to make home/none home have different cache keys
            Mage::getSingleton('cms/page')->getIdentifier() == 'home' ? '1' : '0'
        );
        $cacheId = $shortCacheId;
    
        $shortCacheId = array_values($shortCacheId);
        $shortCacheId = implode('|', $shortCacheId);
        $shortCacheId = md5($shortCacheId);
    
        $cacheId['category_path'] = $this->getCurrenCategoryKey();
        $cacheId['short_cache_id'] = $shortCacheId;
    
        return $cacheId;
    }
    

    This will make the cache key different for homepage / none-homepage pages, which will cache two copies, rather than caching a single template copy for use on all pages.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried following queries to get my facebook fan page insights data SELECT
I have the following two methods: public int Average (params int[] array) { if
Imagine that I have the following two methods: void AddEvenNumbers() { for(int i=0; i<10000000;
I have tried the following <input type=file name=upload multiple=multiple value=MyText> However the text on
I have tried the following MySQL update but it only sets the first field
I have tried the following program for writing the contents into Spreadsheet. I downloaded
I have tried the following: <%= image_tag '...path_to_img', :filter => alpha(opacity=50) %> But it
I have tried the following code but has no effect: Imports system.Runtime.InteropServices <DllImport(UxTheme.DLL, BestFitMapping:=False,
I have tried the following code: $('a.buildMenu').click(function (event) { // Prevent normal behaviour event.preventDefault();
I have tried the following but it seems the folder gets created on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.