On Thu, Dec 2, 2010 at 12:08 PM, Joshua Danger French
<j...@vitamin-j.com> wrote:
> If anyone wants to jump on the bleeding edge, I think the next generation of 
> PageFactory is ready for public use. It works pretty much like PageFactory 1, 
> but drops the PageFactory::Base class. Instead, all part management is done 
> directly on your Page subclasses:
>
>    class EmployeePage < Page
>        part "first name"
>        part "last name"
>        part "department"
>    end
>
> PageFactory 2 also adds management of Page Fields.
>
> Everything is on the 2.0 branch, so you'll have to install the extension and 
> manually check out the new branch. It will probably remain as a vendored 
> extension until we see another release of Radiant.
>
> As always, comments, questions, and bug reports welcomed and appreciated.
>
> j

This idea was too good not to include in the main project.

On edge, Radiant will call new_with_defaults when creating a new page:
https://github.com/radiant/radiant/blob/master/app/controllers/admin/pages_controller.rb#L21

That allows your Page subclasses to initialize their parts and fields.

The core doesn't, however, have things like descriptions for parts or
rake tasks to sync things up.

Does that simplify PageFactory in any way? (I haven't tried it in a while)


-- 
Jim Gay
Saturn Flyer LLC
http://www.saturnflyer.com
571-403-0338

Reply via email to