# Radiant Facets

**URL:** <https://www.ruby-forum.com/t/radiant-facets/104222>\
**Category:** Radiant CMS\
**Created:** [May 15, 2007, 5:11pm UTC](https://www.ruby-forum.com/t/radiant-facets/104222 "2007-05-15T17:11:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![igotimac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/85f322/32.png) [@igotimac](https://www.ruby-forum.com/u/igotimac)\
**Post date:** [May 15, 2007, 5:11pm UTC](https://www.ruby-forum.com/t/radiant-facets/104222/1 "2007-05-15T17:11:19Z")

</div>

The Facets model of Extensions is to break up the page editing interpace  
into regions and parts.

To alter this interface you insert your “part” somewhere into this  
hierarchy. Or you can re-arrange the hierarchy.

```
So for example you would do something like:

Radiant::PageEditorUI.add "admin/page/attributes", :region => :form,

```

:after =\> “edit\_page\_parts”  
Radiant::PageEditorUI.add “admin/page/popups”, :region =\> :popups

The problem with this model is that extensions don’t always want to add  
just  
one button somewhere… sometimes we want to change the organization of  
the  
page editor. We want the freedom to write HTML. So I propose that  
instead  
of making this call in activate, you instead name a partial in your  
extension as the page editor. Ideally, you should be able to name this  
as  
the partial to use for only certain page types.

something like the following declaration in my extension:  
Radient::PageEditorUI.define\_page\_editor do  
| user, session, default |  
if user.admin?  
‘admin/page/my\_special\_admin\_editor’  
else  
default  
end  
end  
where define\_page\_editor is a core method that allows me to specify a  
block  
that can conditionally determine which page editor should be used.

The definition of this partial (my\_special\_admin\_editor) should be to  
call  
all the built in radiant page editor partials, and override / replace /  
reformat as needed

```
So for example you would do something like:

    <%=page_editor_render :edit_form" do %>
        <%=page_editor_render :edit_title"%>
        <%=page_editor_render :edit_extended_metadata"%>
        <%=page_editor_render :edit_page_parts"%>
            <%=render :partial => 'admin/page/attributes'%>
        <%=page_editor_render :edit_layout_and_type"%>
        <%=page_editor_render :edit_timestamp"%>
        <%=page_editor_render :edit_buttons"%>
    <% end %>
    <%=page_editor_render :edit_popups" do %>
            <%=render :partial => 'admin/page/popups'%>
    <% end %>

```

This would allow you to mix in all the HTML etc needed to properly  
format  
these pieces together for your particular setup. This would also give  
you  
the flexibility to solve the problems that will arise when multiple  
extensions want to change the editor.
