Hi i want to create a Magento navigation which shall be visible on the category pages. It is a little confusing.
1. I have a parent category Designer3.
2. It has three sub categories CAT1, CAT2 and CAT3.
3. Now, CAT1 has three subcats: subcat1, sucat2 and subcat3.
Now, when i goto CAT1 page, i want CAT1 CAT2 and CAT3 to be all visible with their subcats in the navigation menu.
Depending upon the current category selected (CAT1, CAT2 or CAT3):
--> if current category is CAT1, CAT1 with its subcats will be displayed first.
--> If current cat is CAT2, navigation will be thus::
CAT2 with its subcats, CAT1 with its subcats and CAT3 with its subcats.
Further, if we select subcategries within CAT1, the position of Nav should be CAT1 - with subcats, CAT2 with subcats and CAT3 with subcats and the CAT1 subcat that is current category now should be highlighted.
Hope this makes sense.
I tried a number of things... but im very challenged when it comes to coding...so
This is what i tired.. this gives me the current category and its sub cats but when a sub cat is clicked it all goes for a toss.... any help and suggestion will be aprrecited... im a little challenged when it comes to magento...
<p><a href="<?php $currentCategory = Mage::registry('current_category');
//Display current category url
echo $this->getCurrentCategory()->getUrl();?>" class="ctActiveTitle">
<?php
$currentCategory = Mage::registry('current_category');
//Display current category
echo $this->getCurrentCategory()->getName();?></a>
<!--SHOWING SUB CATEGORIES OF CURRENT CATEGORY-->
<?php
$obj = new Mage_Catalog_Block_Navigation();// create obj
$cat = Mage::getModel('catalog/category')->load($obj->getCurrentCategory()- >getId()); //get current cat
$subcats = $cat->getChildren(); // find them kids
// loop on it
foreach(explode(',',$subcats) as $subCatid){ // split up the mage data for use
$_category = Mage::getModel('catalog/category')->load($subCatid);
$caturl = $_category->getURL();
$catname = $_category->getName();
// echo a link
echo '<a href="'.$caturl.'" class="ctBrownLink"> '.$catname.'</a>';
}?> </p> <p>Tnaks Moody</p>