Zend Framework navigation with breadcrumbs

Share
Posted on April 26th, 2011 | Posted by admin

It’s been a while since I last time played with beauty of Zend Framework.

Each time I check new features it seems to me that the things are more simplier than the last time,
I might be wrong (I wouldn’t bet on that) or I’m just getting better :)

Let’s check this piece of cake – how you can create navigation with breadcrumbs in Zend Framework project.
As many things in Zend Framework you can get same features in different ways,
so the same thing goes with the Zend_Navigation class.

First of all you need to decide which way you will choose:
- navigation with xml setup file or
- from application.ini file

Magento Navigation, how to customize very helpful information?

Share
Posted on March 23rd, 2011 | Posted by admin

This post describes how Magento navigation works. I hope it will help you.
The begining of all is in template file: “category/navigation/top.phtml”

1
2
3
4
5
6
7
8
<ul id="nav">
< ?php
foreach ($this->getStoreCategories() as $_category): ?>
< ?php
echo $this->drawItem($_category);
?>
< ?php endforeach ?>
</ul>

There we call the method from class Mage_Catalog_Block_Navigation $this->getStoreCategories(). This method returns the array $_nodes from object Varien_Data_Tree_Node_Collection.

This array contains objects of Varien_Data_Tree_Node.
Every node is object of Varien_Data_Tree_Node and it is extension from Varien_Object.

Magento Navigation, how to customize very helpful information?

Share
Posted on February 23rd, 2011 | Posted by admin

Magento Navigation, how to customize very helpful information?

This post describes how Magento navigation works. I hope it will help you.
The begining of all is in template file: “category/navigation/top.phtml”

1.<ul id="nav">
2.< ?php
3.foreach ($this->getStoreCategories() as $_category): ?>
4.< ?php
5.echo $this->drawItem($_category);
6.?>
7.< ?php endforeach ?>
8.</ul>

Editing the Magento Navigation

Share
Posted on February 23rd, 2011 | Posted by admin

This is not a comprehensive example (I didn’t write out an example of editing the navigation myself … yet) – but I will point out where the files are that you need to edit the top and left navigation.

This is a tad complicated because of the use of javascript in the navigation, but it’s not too bad. It ends up being a bunch of functions which just spits out the proper HTML and javascript to get things going (and some code to retrieve the categories).

First off, the template files.
The files that have the HTML are located here:

Custom category menu navigation in Magento

Share
Posted on February 22nd, 2011 | Posted by admin

Just some code for custom category menu navigation. I’m a bit short on time so, no fancy walk trough. All you need to make this show on your page is to call it inside layout file like

<block type=”core/template” template=”surgeworks/customcatnav.php” />

Filename: customcatnav.php.

01.<?php
02.//Get store id
03.$storeId = Mage::app()->getStore()->getId();
04.
05.//Get category model
06.$_category = Mage::getModel(’catalog/category’)->setStoreId($storeId);
07.
08.$_categoryCollection = $_category->getCollection();
09.$_categoryCollectionIds = $_categoryCollection->getAllIds();
10.
11.//Remove root category from array
12.unset($_categoryCollectionIds[0], $_categoryCollectionIds[1]);
13.