refinery/refinerycms — pull request #2619 by anitagraham (2014-06-21 06:08:17+00:00)
Title: Extend page options

This pull request is a suggestion for splitting Advanced Page Options into separate sections and allowing plugins to register a page-options template which would become one of the Page Options sections.

The changes in the page edit screen are shown in the attached images.

The initial idea was driven by my need to give refinerycms-testimonials a way to control how/which testimonials were displayed on a page. The current implementation puts the testimonials options fields into an edit tab but becoming part of page options seemed more appropriate. While looking into this I noted that SEO options are treated as a special case and just included in advanced options. Continuing to add special cases to add to advanced options is unsustainable.

This initial implementation treats Page Options and SEO options as special cases too, but leaves the way open for them to become 'regular', registered page options. (See https://github.com/anitagraham/refinerycms/blob/extend-page-options/pages/app/helpers/refinery/admin/pages_helper.rb)

![page options - all closed](https://cloud.githubusercontent.com/assets/397118/3347881/d7754d80-f901-11e3-9f7d-9adbb07f9d20.png)
+ Each of the three options can be unrolled/rolled up independently.
+ Other plugins can register templates to appear in this section of the page

![page options - open](https://cloud.githubusercontent.com/assets/397118/3347880/d7729810-f901-11e3-8e2f-2f41dcab5e76.png)
+ The standard view of the Advanced Page Options doesn't include SEO options.

![page options - page and seo options open](https://cloud.githubusercontent.com/assets/397118/3347879/d753093c-f901-11e3-9c15-9ba27be6d4de.png)
+ Page Options and SEO options unrolled. This is the same as the current system's Advanced Page Options.

![page options - seo and testimonial options open](https://cloud.githubusercontent.com/assets/397118/3347878/d7508b6c-f901-11e3-8468-d15f723d3175.png)
+ Plugins can register a page options template.
+ Any combination of options can be rolled up or down.

_All current tests have passed (with changes to the text of the Advanced Page Options link)_
_Tests for the new functionality have not yet been written_