Forum: Radiant CMS Radiant Facets

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jacob B. (Guest)
on 2007-05-15 19:11
(Received via mailing list)
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
one button somewhere... sometimes we want to change the organization of
page editor.  We want the freedom to write HTML.  So I propose that
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
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?
where define_page_editor is a core method that allows me to specify a
that can conditionally determine which page editor should be used.

The definition of this partial (my_special_admin_editor) should be to
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
these pieces together for your particular setup.  This would also give
the flexibility to solve the problems that will arise when multiple
extensions want to change the editor.
This topic is locked and can not be replied to.