3

I have been asked to look after and do some work on this site:

http://tapesonline.co.nz/

It's mostly straightforward so far except:

  1. I cannot find where to edit the top navigation menu. The existing top menu pages are NOT listed in the 'Manage Categories' section of the admin panel, so I'm not sure where to change them in the
    navigation menu.

  2. I need to edit the Contact content page but it is not listed in the pages section.

I have searched google to no avail.

Please steer me in the correct direction.

Any help appreciated!

Thank you!

3

That topmenu doesn't appear to use Magento's renderer at first glance. It looks more like a static html template, probably located somewhere in app/design/frontend/yourpackage/yourtheme/template/page (wild guess) or somewhere similar.

Grep for unique identifiers (i.e. class/content) that might live in a template/block - you should find it pretty easily that way. Alternatively/additionally you can enable template path and block hints as outlined here

  • thanks, I used the 'Enable Template/Block Hints' to edit the contact page – Tim Dec 9 '14 at 1:13
0

The big fact is topmenu can be some other links except categories and I think that is what happens here. I am suspecting that, via a layout update or programmatically those menus are included in top menus.

Let us take the case of categories. Categories are included in menu programmatically. In Mage_Catalog module, you can see that, it is listening to an event page_block_html_topmenu_gethtml_before. This is a perfect event which will use by Magento to update topmenu items. Now if you look on the observer method and investigate further, then you will reach in this function at last.

protected function _addCategoriesToMenu($categories, $parentCategoryNode)
    {
        foreach ($categories as $category) {
            if (!$category->getIsActive()) {
                continue;
            }

            $nodeId = 'category-node-' . $category->getId();

            $tree = $parentCategoryNode->getTree();
            $categoryData = array(
                'name' => $category->getName(),
                'id' => $nodeId,
                'url' => Mage::helper('catalog/category')->getCategoryUrl($category),
                'is_active' => $this->_isActiveMenuCategory($category)
            );
            $categoryNode = new Varien_Data_Tree_Node($categoryData, 'id', $tree, $parentCategoryNode);
            $parentCategoryNode->addChild($categoryNode);

            if (Mage::helper('catalog/category_flat')->isEnabled()) {
                $subcategories = (array)$category->getChildrenNodes();
            } else {
                $subcategories = $category->getChildren();
            }

            $this->_addCategoriesToMenu($subcategories, $categoryNode);
        }
    }

This function do mainly three things.

  1. It will first collect all category tree list and iterate through them and in each time create an array with necessary keys $categoryData

  2. Now it will set this array to an object which would be a new instance of Varien_Data_Tree_Node

  3. Then this object is just get added to the topmenu block using the method addChild()

So the key point that you need to understand is, the exact same thing is happening some other module in your system via a layout update or programmatically. Your job is to find exactly where this happens.

In order to find any layout update that is related to top.menu, you can perform a grep operation.

  grep -r top.menu

In order to find where topmenu updation happens programmatically

  grep -r page_block_html_topmenu_gethtml_before

Hope that would helpe you to resolve this issue.

  • thanks for your help! unfortunately I am not that much of an advanced user so I didn't really understand how to implement your solution. – Tim Dec 9 '14 at 1:35

Your Answer

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

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