The latest contract I’ve been working on is using Radiant, and they
needed this functionality. The extension will work on 0.6.2, but I
highly recommend using edge for the sake of bugfixes.
There have been some significant changes in the API that I should warn
you about if you used the facets branch before:
‘facets-lite’ is still supported. Existing extensions that use this
should not break.
Some of the region names may have been changed or added.
There are no more ‘plain’ partials. Everything exists in a region or
is rendered directly from a template.
Use content_for :page_scripts and content_for :page_css to insert
inline Javascripts and CSS, respectively. content_for appends to its
result anyway, so it was not necessary to keep ‘additional_javascripts’
and ‘additional_styles’ in the API. If you have external files, you can
still use ‘include_javascript’ and ‘include_stylesheet’.
Regions are still accessible from the ‘admin’ object, but are accessed
like so:
Regions are blank by default, so you can reference a region without it
being pre-existing.
Any controller/action may have regions that are rendered. These are
determined by the controller name and template name. See the
implementation of the ‘render_region’ helper for details.
If you want to add your own controllers and actions/templates, add an
attr_accessor to Radiant::AdminUI with the controller name, fill that
attribute with an OpenStruct, then assign Shards::RegionSet objects to
the struct by template name. For example, if I have an “events”
controller and I want to add regions to its “index” template, I would do
this in the ‘activate’ method of my extension:
You can pass a block to RegionSet.new, which will yield itself to the
block.
The only pages that can be modified out-of-box at the moment are:
Page edit/new (as before)
Page index (limited)
The core of the API is pretty solid and well tested, but I would
entertain any patches that extend the reach into the other areas of the
administration interface.
just few thoughts on this subject.
maybe everything can be much more simple?
i understand that it is very cool when you install extension and yore
administrative part is full of new buttons and toys to play with but why
exactly do we need it in this way?
basically my suggestion is to give extensions more freedom - just put a
new
tab for each extension and let it work as expected without any
interference
with others
you need to reorder pages? click on reorder tab and modify the tree as
you
want.
you need to manage your galleries? galleries tab will show you only
gallery
type pages.
same for page attachments - each page can be expanded to see attached
files.
as for filters - same thing. when you go to page edit you will have a
tab
for each filter.
tab for each extension and let it work as expected without any interference
with others
They already have this ability. The primary reasons for adding
flexibility to the administration interface is to promote a workflow
that makes sense. Reordering pages seems like something that should be
intimate with the page-related workflow. Yes, another tab is easier,
but it may not be the most intuitive solution.
One feature my client needs is a “popup” menu on the “Add Child” button
to select a specific page-template before opening the edit interface.
That couldn’t be done without some way to inject code into the sitemap
page.
you need to reorder pages? click on reorder tab and modify the tree as you
want.
you need to manage your galleries? galleries tab will show you only gallery
type pages.
same for page attachments - each page can be expanded to see attached files.
as for filters - same thing. when you go to page edit you will have a tab
for each filter.
I understand your concern. It’s easy to get a bloated mess, but it
should be the responsibility of individual extension designers to make
sure their modifications add meaningfully to the interface and don’t
detract from it.
Ideally, no extension would alter the other views, but for most
situations this isn’t practical. I thinks the shards extension is
actually a very elegant way to handle this issue.
But is it just me or does it give a “no method error” when the
children are expanded? I have tried it on a fresh install, but keep
getting an error. I am using the gem, updated to edge and no other
extensions.
NoMethodError in Admin/page#children
Showing vendor/extensions/shards/app/views/admin/page/_node.rhtml
where line #39 raised: