Hot answers tagged

22

To do this you'll first want to (if you haven't already) create a custom template directory within the RWD design package. This avoids re or overwriting your default templates that live in magento/app/design/frontend/rwd/default/template. For the sake of example we'll create magento/app/design/frontend/rwd/custom/template The specific template we're going ...


17

Solution 1 : You need to have all your categories UNDER the "Default Category". Then they should show. Solution 2 : Verify that Default Category Is Active (Enable category = "yes") and "Include in Navigation Menu" to Yes. Clear your cache by running the php bin/magento cache:clean command and check it will works. Update : Just go to the Stores -> All ...


13

I agree with Fabian Blechschmidt. Without any extension,it's not possible. But there is an alternative Basically, we use cms page for cms content management. As per as my knowledge,there is a process in category system where you can manage cms content. Just create a cms static block and assign that static block to category from Display setting tab. ...


11

Try this: $collection = Mage::getResourceModel('catalog/category_collection') ->addAttributeToSelect('*') ->addAttributeToFilter('is_active', 1) //only active categories ->addAttributeToFilter('include_in_menu', 0) //only categories not included in menu ->addAttributeToFilter('parent_id', 10)//get only subcategories of the ...


10

After struggling a bit here is the solution I found. I let my observer execute after the one in Mage_Catalog and decided to re-create the menu entirely. The main idea is to get all the existing menu items put them in a temporary array, remove them from the menu then add my links between the existing items and in the end add all items to the menu again. ...


9

According to app/design/adminhtml/layout/main.xml this block is loaded for the menu: <block type="adminhtml/page_menu" name="menu" as="menu"></block> So that concludes that Mage_Adminhtml_Block_Page_Menu (function _buildMenuArray) takes care of building the menu and processing everything. Of course many different components are used in this ...


9

Late to the party here, and I think you've probably already figured it out by now, but you need to have categories UNDER the "Default Category". Then they should show.


9

Look at vendor/magento/module-catalog/etc/di.xml <type name="Magento\Theme\Block\Html\Topmenu"> <plugin name="catalogTopmenu" type="Magento\Catalog\Plugin\Block\Topmenu" /> </type> As we can see, Magento uses Plugin - Magento\Catalog\Plugin\Block\Topmenu to override some methods of Magento\Theme\Block\Html\Topmenu class. We ...


8

Goto app/design/frontend/rwd/default/template/page/html and open topmenu.phtml file. find this code <?php if($_menu): ?> <nav id="nav"> <ol class="nav-primary"> <?php echo $_menu ?> </ol> </nav> <?php endif ?> this code will output you the categories in the form of top menu if ...


7

In Magento 2 you need to create menu.xml file in your module's etc/adminhtml folder. Here is example of menu.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Backend/etc/menu.xsd"> <menu> <add id="Lapisbard_StoreLocator::storelocator" title="...


7

Judging by your admin screenshot, is there any reason you are using two FPCs? Lesti_FPC and Evolved Caching? Normally only one FPC is needed, and judging by Evolved caching documents it has more support for things like Varnish, etc. compared to Lesti_FPC. Basically you are doubling the work of the caching mechanisms and over complicating caching by having ...


7

After following major tutorials and troubleshooting web pages it turned out the issue lies with my hosting configuration. Varnish Cache seems to be the cause of the menu disappearing. Disabling Varnish causes the menu to not show. The solution is to enable Varnish Cache and the menu appeared again which is kinda bizarre for me and hard to understand. ...


7

please update your menu.xml like below: <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd"> <menu> <add id="Vendor_Module::section" title="Section" module="Vendor_Module" sortOrder="50" resource="Vendor_Module::section"...


6

Welcome to Magento.SE! While this is not necessarily a Magento question (it's really more a CSS/jQuery question) there is a particular way that I would handle this in CE1.9+ In your own custom styles.css file: .sticky { position: fixed; top: 0; z-index: 9999; } And now in a custom javascript I would include the following: (function($, w){ ...


6

For your information, even though the answers posted look like valid answer, it is recommended to use service contracts in Magento 2. In your case a valid code would be to first inject the right service contract class in your constructor: protected $_pageRepositoryInterface; public function __construct( ... \Magento\Cms\Api\PageRepositoryInterface ...


6

1) To remove sign up and sign in links edit your default.xml code at below location. /app/design/frontend/Infortis/base/Magento_Theme/layout/default.xml Add these lines of code <referenceBlock name="top.links"> <referenceBlock name="register-link" remove="true" /> <!--for sign up Link--> <referenceBlock name="...


6

Login to Admin: Step 1) Click on Catalog >> Categories. Step 2) Select Category you want to add in main menu. And select "Include in Menu" => Yes Step 3) Run command php bin/magento cache:flush Now check in frontend category show in main menu. Done.


5

Change <li class="<!--active class here if child is current -->"> To <li<?php echo in_array($_category->getId(), Mage::registry('current_category')->getPathIds()) ? ' class="custom-active-class"' : '' ?>> EDIT: You need to add the category id to the cache key to make it work. Otherwise this solution wouldn't work with block ...


5

Another alternative if you don't have a lot of CMS pages to add would be: Create a category Create your cms page Create an URL rewrite that redirects your category to your cms page. Thus, you will have a link in the menu and that link would redirect to your CMS page. Example: Category: Name: About Us URL Key: about-us ID: 4 CMS page: Name: About Us ...


5

By using remove tag you can remove a menu item from admin menu. Syntax should be <remove id="MENU_ITEM_ID" /> Suppose I want to remove Cms page section from menu, then I have to rewrite below code at menu.xml of my module. <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="...


5

@media="screen and (max-width: 767px){ .nav-sections { background: #eee; -webkit-transition: top 0.3s; -moz-transition: top 0.3s; -ms-transition: top 0.3s; transition: top 0.3s; width: 100%; top: -80%; top: calc(-1 * (100% - 54px)); overflow: ...


5

The JS for the menu that has that functionality can be found in lib/web/mage/menu.js First create the folder structure in your theme ex: [Namespace]/[theme_name]/web/mage/ And copy menu.js from lib/web/mage/menu.js to [Namespace]/[theme_name]/web/mage/menu.js And change mediaBreakpoint: '(max-width: 768px)' to mediaBreakpoint: '(max-width: ...


5

This happened to me when I made a custom theme. I created a theme.js file in app/design/fontend/<CUSTOM_THEME>/default/web/js/ to use some library I added. But I forgot to copy the code that where already there in the theme.js of the blank theme (/vendor/magento/theme-frontend-blank/web/js/theme.js). Here is the JavaScript line which clones the ...


4

The event adminhtml_block_html_before can be hooked to manipulate the configuration that the menu depends on: In the config.xml we add: <adminhtml> <events> <adminhtml_block_html_before> <observers> <my_module> <type>singleton</type> &...


4

Since there is no way (not that I know of) to sort the order of the observers on an event ...I have a problem. Ah, but there is! In your module declaration file, set the dependency of Mage_Catalog to your module, e.g.: <modules> <Your_Module> <active>true</active> <codePool>local</codePool> </...


4

As far as I know this is the cleanest and best solution to do so. I've tried it in different ways but it all requires 'hardcoded' values at some level. Just a small tip, when you change the placement of the menu item you should check for the _isAllowed method in the adminhtml controller. There's probably a line of code like return Mage::getSingleton('admin/...


4

There are basically 2 options for this. 1) You can loop through these options creating a list of links which you can place on a block that will be your menu. The links will be directed to the advanced search page*. $attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_product', 'brand'); if ($attribute->usesSource()) { $options = $...


4

As mentioned in comments to OP question, this is a duplicate of Possible to hide admin menu if custom module is disabled? but placed as answer to respond to OP's comments. You will place the <depends> in the menu item configuration, as such: (code example taken from ecomdev's post mentioned in the noted duplicate answer) <menu> &...


4

I had same problem, after some coding I made this in template/catalog/navigation/left.phtml: first line: <?php $ct = Mage::registry('current_category')->getID(); ?> in the end of the file(before endif;) <?php elseif( $ct == 92 || $ct == 85 || $ct == 224): ?> <?php $currentcategory = Mage::registry('current_category'); $subcategorys = ...


4

You need to look in the proper adminhtml.xml file that adds a menu close to the one you want to add one. Let's say you want to add a menu between Sales and Catalog main menus. This means you have to look for the proper adminhtml.xml files that add the menus mentioned above. By the name of the menus you should look in Mage_Sales and Mage_Catalog. You will ...


Only top voted, non community-wiki answers of a minimum length are eligible