There are some ways you could do this. I've just spent some time looking at one, but I misread your post, so its not quite what you want.
My approach centred on defining different page types, each with a different set of predefined page_parts.
However to make choice at the time of creating the page part
1. You would need to have a list of predefined page_part types
2. Add a page_part_type selection to the _form_new_page_part.rb partial,
3. and now it requires a bit of thinking... you need to ensure that the part is rendered with the correct partial.
I have used a variation of tabs to get an engine to display partials as editor tabs.
config.after_initialize do
tabs = [
{ title: 'Admin Tools', partial: 'admin_tools' },
{ title: 'Tips', partial: 'visual_editor_text', field s: :tips },
{ title: 'SEO', partial: 'seo' }
]
tabs.each do |t|
Refinery::Pages::Tab.register do |tab|
tab.name = t[:title]
tab.partial = "/refinery/products/admin/products/tabs/#{t[:partial]}"
tab.fields = t[:fields]
end
end
end
This will display these tabs for all pages.
Will keep on thinking about it.