Tim Fountain wrote: > > Technically the breadcrumbs helper only needs the current page and its > parents, [...] if the Zend_Navigation data structure could be > cached in a tree like form matching the URL structure, some clever caching > mechanism could just include the bits it needs. But this would be tricky > to > implement. >
You can extend the Zend_Navigation_Page_MVC and populate all the sub pages from your database, this fills out your tree. You can Cache the Zend_Navigation object and this saves calculating it again. The 2 problems with this way is: Is it wise to have 10,000 page objects for a large site? Most of the Zend_Navigation view helpers need to know the current page, so it loops over all pages. Looping over 10,000 page objects? crazy. Now if I go through the uses for it (in documentation): Breadcrumbs: Mime are usually Module > Controller > Action > Dynamic page - Will not help me here Links, used for rendering navigational head links: (Who uses these?) - Will not help me here Menu, used for rendering menus: I have to do this in the controller, because only the controller knows the data/item/dynamic info. - Will not help me here Sitemap, used for rendering sitemaps: The only time I think you need xml sitemaps is when you have many pages. Zend_Navigation does not work for lots of pages so this is stupid. Also, I have never ever seen a good programmatical way of getting all pages for xml sitemaps. Most methods miss a lot of dynamicly generated webpages (eg Zend_Navigation) or are process intensive (crawl the entire site just to get the urls). The best way I have seen to create xml sitemaps is to simply get all requested urls (ether from log files or add them to the db when they succeed). - Will not help me here Just because it is there, does not mean you have to use it. -- View this message in context: http://www.nabble.com/Creating-a-dynamic-database-based-Zend_Navigation-item--tp23777517p23813437.html Sent from the Zend Framework mailing list archive at Nabble.com.
