View Single Post
  #2  
Old 04-13-2014, 09:06 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Removing/Editing the Primary Menu (Solved)

So what was needed is to remove the top menu so I could add my own, I believe it would be normally accomplished by extending the class
XLite\View\Menu\Customer\Top

In this case though, the module CDev\SimpleCMS already extended this class. As of now, I don't know a way to extend another modules extension. Since CDev came after Baby (my company id) alphabetically, then its changes were overwriting my own when I tried to extend the class.

First I tried removing the template top_menu.tpl by using the function removeTemplateFromLists contained in XLite\Core\Layout.php, but found it was not included in the "template lists". Instead I ultimately used this code in my Baby\DropDown\Main.php file:
Code:
public static function runBuildCacheHandler() { parent::runBuildCacheHandler(); \XLite\Core\Layout::getInstance()->removeClassFromLists( 'XLite\View\Menu\Customer\Top' ); }
This unset the viewer class that was calling the template completely. My next move is to include my new template with my code to display the menu.

Any suggestions or comments welcome! Please let me now if I am doing this wrong or right.

-Mike
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote