Op Monday 01 June 2009 13:17:13 schreef Mary Nicole Hicks:
> 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.

Hi all,
In my opinion you should only store the top-level of the dynamic pages in your 
navigation structure at first sight.

I have a cms where you might have a blog at website.com/something/here/blog 
and a agenda at website.com/something/else/agenda. Those "overview" pages are 
stored in the database and are always visible in Navigation (menu, sitemap 
etc). This object is stored in cache.

When the blog module is in the dispatch loop, it adds some pages to the 
navigation object (like website.com/something/here/blog/archive). Visiting a 
blog post (.../blog/1/blog-title-here), some blog articles are added too.
These "special" pages are not visible in sitemap, but when that deep into the 
website, they are visible in the menu and/or breadcrumbs and/or links.

I think this method is on with the most advantages: store common pages in 
cache, but still dynamic when required.

Regards, Jurian

--
Jurian Sluiman
Soflomo.com

Reply via email to