Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created October 25, 2011 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/1310946 to your computer and use it in GitHub Desktop.
Save anonymous/1310946 to your computer and use it in GitHub Desktop.
Magento EAV Attribute for Category
INSERT INTO `eav_attribute` VALUES(132, 3, 'include_in_left_menu', NULL, NULL, 'int', NULL, NULL, 'select', 'Include in Left Navigation Menu', NULL, 'eav/entity_attribute_source_boolean', 0, 0, '1', 0, NULL);
<?php $parentCategoryId = 2;?>
<?php $_categories = Mage::getModel('catalog/category')->load($parentCategoryId)->getChildrenCategories() ?>
<?php $_count = is_array($_categories)?count($_categories):$_categories->count(); ?>
<?php if($_count): ?>
<div class="block block-layered-nav">
<div class="block-content">
<dl id="narrow-by-list2">
<?php $parentCategoryId = 2;?>
<dt><?php echo $this->__('Our Kitchen Range') ?></dt>
<dd>
<ol>
<?php foreach (Mage::getModel('catalog/category')->load($parentCategoryId)->getChildrenCategories() as $_category): ?>
<?php if( $_category->getIsActive() && $_category->getIncludeInLeftMenu()): ?>
<li>
<a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->htmlEscape($_category->getName()) ?></a>
</li>
<?php endif; ?>
<?php endforeach ?>
</ol>
</dd>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment