views:

166

answers:

1

I would like to know how people use Zend_Navigation, what are the best practices to employ to get the most out of it?

My company has built our last 2 major projects using Zend Framework, we have used a combination or Zend_Navigation the url view helper. Using the url view helper has caused lots over extra work when having to refactor code.

I would like to hear about other Zend Framework programmers use of Zend_Navigation, does anyone use it as the primary source for all links throughout the site? If so how do you approach this?

General information - The sites we have been building generally have around 10,000 to 15,000 pages in them.

A: 

I've only really used Zend_Navigation for its XML sitemap and breadcrumb functions, which in my opinion are its strengths. When you say "primary source for all links throughout the site" I assume you mean using it for menus?

One problem I had with it early on was that all the examples assume you are able to create a single data structure which contains all the pages on your site. This is fine for small sites but quite impractical once you pass about 100 pages. Since you only really need the full data structure for the XML sitemap, my solution to this was to create a controller plugin which looks at the URL and assigns just the items that make up the current path to Zend_Navigation. This allowed me to use its helpers for breadcrumbs. I then only need to build up the full data structure to generate the XML sitemap, which is cached.

Tim Fountain