Forum: Radiant CMS [ANN] PageFactory 2.0

Posted by 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
Posted by 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)
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.