# \[ANN\] PageFactory 2.0

**URL:** <https://www.ruby-forum.com/t/ann-pagefactory-2-0/200002>\
**Category:** Radiant CMS\
**Created:** [December 2, 2010, 6:09pm UTC](https://www.ruby-forum.com/t/ann-pagefactory-2-0/200002 "2010-12-02T18:09:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [December 2, 2010, 6:09pm UTC](https://www.ruby-forum.com/t/ann-pagefactory-2-0/200002/1 "2010-12-02T18:09:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Joshua\_Danger\_Frenc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f14d63/32.png) [@Joshua\_Danger\_Frenc](https://www.ruby-forum.com/u/Joshua_Danger_Frenc)\
**Post date:** [December 2, 2010, 8:06pm UTC](https://www.ruby-forum.com/t/ann-pagefactory-2-0/200002/2 "2010-12-02T20:06:02Z")

</div>

On Thu, Dec 2, 2010 at 12:08 PM, Joshua Danger French  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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/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)
