2017 © Pedro Peláez
 

magento-module mbiz_menu

Magento module which gives a better menu block.

image

monsieurbiz/mbiz_menu

Magento module which gives a better menu block.

  • Tuesday, March 13, 2018
  • by jacquesbh
  • Repository
  • 2 Watchers
  • 2 Stars
  • 40 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 5 % Grown

The README.md

Mbiz_Menu

Mbiz_Menu is a Magento 1 module which provides an optimized menu as a simple block., (*1)

Usage

The block mbiz_menu/page_html_topmenu gives 2 methods:, (*2)

  1. getCategoriesTree() which returns main categories with children. Children are available using the method $cat->get_children().
  2. getCategories which returns all the categories available in the menu.

Each category has 2 new data available:, (*3)

  • contains_current_category is set to true if the category has the current category in its children.
  • is_current_category is set to true if the category is the actual current one.

Example

No template is provided. But here is an really simple example:, (*4)

<?php
/* @var $this Mbiz_Menu_Block_Page_Html_Topmenu */
$_tree   = $this->getCategoriesTree();
$_output = $this->helper('catalog/output');
?>
<ul>
<?php foreach ($_tree as $_mainCategory): ?>
    <li class="<?php if ($_mainCategory->getIsCurrentCategory() || $_mainCategory->getContainsCurrentCategory()): ?>active<?php endif; ?>">
        <a href="<?php echo $_mainCategory->getUrl(); ?>">
            <?php echo $_output->categoryAttribute($_mainCategory, $_mainCategory->getName(), 'name'); ?>
        </a>
        <?php if ($_children = $_mainCategory->get_children()): ?>
        <ul>
            <?php foreach ($_children as $_child): ?>
            <li class="<?php if ($_child->getIsCurrentCategory()): ?>current<?php endif; ?>">
                <a href="<?php echo $_child->getUrl(); ?>">
                    <?php echo $_output->categoryAttribute($_child, $_child->getName(), 'name'); ?>
                </a>
            </li>
            <?php endforeach; ?>
        </ul>
        <?php endif; ?>
    </li>
<?php endforeach; ?>
</ul>

By default the block uses a 72 hours cache lifetime. Of course the default value can be overrided., (*5)

The Versions

13/03 2018

dev-master

9999999-dev

Magento module which gives a better menu block.

  Sources   Download

GPL-3.0

19/01 2017

0.1.1

0.1.1.0

Magento module which gives a better menu block.

  Sources   Download

GPL-3.0

11/06 2016

0.1.0

0.1.0.0

Magento module which gives a better menu block.

  Sources   Download

GPL-3.0