Forum: Radiant CMS [ANN] PageFactory 2.0

70a9fc0b4226784056eb64257cd4a889?d=identicon&s=25 Joshua Danger French (Guest)
on 2010-12-02 18:09
(Received via mailing list)
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
09477c358c5897d44121a248326e16d7?d=identicon&s=25 Jim Gay (Guest)
on 2010-12-02 20:06
(Received via mailing list)
On Thu, Dec 2, 2010 at 12:08 PM, Joshua Danger French
<josh@vitamin-j.com> wrote:
> 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...

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)
This topic is locked and can not be replied to.