cancel
Showing results for 
Search instead for 
Did you mean: 

observer and theme

observer and theme

Hi,

 

sometimes ago inside my custom module etc/config.xml I did put this:

 

<page_block_html_topmenu_gethtml_before>
		<observers>
			<catalog_add_topmenu_items>
				<class>ShoppingPlus_Frontend_Model_Observer</class>
				<method>pageBlockHtmlTopmenuGethtmlBefore</method>
			</catalog_add_topmenu_items>
		</observers>
 </page_block_html_topmenu_gethtml_before>

then in the Observer I created the function to create the menu from cms pages as I wanted. This works perfectly.

Now they asked me to change theme, they choose this:

 

http://themeforest.net/item/mango-responsive-magento-theme/11629375?from=selectpage&ref=SW-THEMES

 

I did install it, but the Observer function now isn't called at all. I had a look inside the theme to see if they did rewrite the method, but doesn't look like this.

How can this be?

 

Thanks a lot

4 REPLIES 4

Re: observer and theme

It is likely that the new theme is not using the topmenu block. Are you able to confirm if that is the case or not?

Problem solved? Click Accept as Solution!
www.iwebsolutions.co.uk | Magento Small Business Partner

Re: observer and theme

Hi,

 

thanks a lot for you answer.

 

Yes, it's using it. Inside header.phtml I can see:

 

<?php echo $this->getChildHtml('topMenu') ?>

which is why I expected to see my pages. Am I right?

 

thanks again

Re: observer and theme

Ok maybe this can help finding an answer. This new theme, in the layout folder, has a page.xml which contains:

 

<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
                    <label>Navigation Bar</label>
                    <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/>
</block>

and in the menu I have only one item: Home. So somewhere should be generated.

Is this of any help?

 

Thanks a lot

Re: observer and theme

So this new theme has some options in the backend. It installed an extension called MegaMenu, which was enabled by default. Disabling this extension now my Observer is called again. I'd love to understand how everything works Smiley Happy

 

Thanks