I did a major no-no by refactoring this during the release candidate
process, so that's strike one against me.
There were 2 things that I tried to tackle with changes to the "Add Child" menu:
1) Pages should be allowed to limit their children of certain types,
like "Archive" which only needs 1 year/month/day index.
2) We had a lot of menu-controlling code in models, helpers, and views
and it just felt messy.
When I first attempted to solve #1 the code would read a lot of data
from the database; this drastically slowed things down on sites with
large numbers of pages.
#2 is solved by extending each page object with the MenuRenderer
module (and any special modules that exist for the page type, such as
ArchiveMenuRenderer)
I wanted to do a more serious refactoring of our views with decorators
but opted to cut some things to get a release out.
So I stuck with using the "render_node" method in our node_helper.rb
and extending the page with a module containing the methods needed.
https://github.com/radiant/radiant/blob/master/app/helpers/admin/node_helper.rb#L7
The downside of this is that it makes it a little harder to
metaprogram changes into the menu, but that could be solved by
providing a simple hook for additional features.
Are you merely trying to add another page type to the list after the
database already has the cache without that item? Or is there more as
well?
-Jim
--
Write intention revealing code #=> http://www.clean-ruby.com
Jim Gay
Saturn Flyer LLC
571-403-0338