| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Removing/Editing the Primary Menu (Solved) | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Removing/Editing the Primary Menu (Solved)
Previously I was discussing this problem in this thread:http://forum.x-cart.com/showthread.php?t=69010
What we are trying to accomplish is remove and edit the top menu also known in the CDev\SimpleCMS modules as the Primary Menu. I struggled with this for a while, and realized there were several teaching points here that I could use to help others. Removing the Primary Menu: So without further ado I reveal the second of my tutorials on X-cart 5: http://youtu.be/byLG9q13pxk You can find all of my X-cart 5 tutorials here: http://forum.x-cart.com/showthread.php?t=64668
__________________
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. |
|||||||||
#2
|
|||||||||
|
|||||||||
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:
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. |
|||||||||
#3
|
|||||||||
|
|||||||||
Re: Removing/Editing the Primary Menu (Solved)
If you want to wipe the menu completely and replace it with your custom one, you can make the \XLite\View\Menu\Customer\Top::isVisible() return FALSE (so that the widget won't show up on the page at all), and add a new custom widget having @ListChild (list="layout.main", weight="250") in its declarations.
|
|||||||||
|
#4
|
|||||||||
|
|||||||||
Re: Removing/Editing the Primary Menu (Solved)
Slava,
Thanks! Anything wrong with the way I did it?
__________________
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. |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: Removing/Editing the Primary Menu (Solved)
The way you did it will work (and, I guess, it will be a bit better in terms of the performance). However, runBuildCacheHandler() is not the place that you look into when investigating why the menu is not displayed on the page Your way may be confusing for other developers customizing your code later.
|
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|