Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend page options #2619

Closed
wants to merge 8 commits into from

Conversation

anitagraham
Copy link
Contributor

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

  • 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

  • The standard view of the Advanced Page Options doesn't include SEO options.

page options - page and seo options open

  • 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

  • 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

Plugins can specify a page-options template to use
Add new attribute to Refinery::Plugin for plugins to register their
page_options template.
@parndt
Copy link
Member

parndt commented Jun 21, 2014

@ugisozols what do you think?

@parndt
Copy link
Member

parndt commented Jun 21, 2014

This idea makes sense, let me think about it more and await other feedback. @gwagener @simi any opinion?

@gwagener
Copy link
Contributor

I'm not clear on how it will look when three options are unrolled. Would it make sense to rearrange things so each option is full width and they just stack on top of each other when multiple are unrolled? What happens in the unlikely event there are lots of options, do they wrap underneath?

I like the idea of having a nice plugin system to Refinery's god object. However it occurs to me that we already have one such system with the tabs. Would it make more sense to make the page options and SEO options tabs like page images and copywriting? Or would it make sense to do away with tab extensibility and make copywriting and page images options that unroll, leaving tabs purely for page parts?

From a less important, stylistic perspective I'm confused about the two icons for each plugin. If they don't have different functionality I think it would be best to just have one icon.

All in all I think this is a good start to a good improvement.

@anitagraham
Copy link
Contributor Author

@gwagener and others:

I've attached a screenshot showing all three options open. I was surprised that the css worked, but happy to leave it that way. Having full width options works in one sense, although in other circumstances I have found that short fields in wide containers beg for the half-width look that you have here. Each option box could be striped (subtly) to distinguish it from its peers.

If there were many option links I imagine they would wrap onto the next line. (What would happen to the draft page checkbox? It is a special case that I have pushed into the options container because it got lost otherwise.) You could also consider providing the option section as another tab set. I decided not to do that in an initial implementation, anyway.

Two icons: yes it does look wrong. The front icon is the original options icon. The green arrows are intended to indicate that the option will roll up/down.

Tabs vs Options
I also have the refinery-testimonials options as a tab - that was my original implementation. Because it is not directly setting page content and isn't a page part I thought it would be better as a page option.

Page images, otoh, do directly set page content. A page with page-images should have an implied 'images' page part. (I am still thinking about how this should happen, wrt #2615)

Perhaps tabs should be for user editable page content.
Options should be for settings (which may generate page content)

The relationships between plugins/editor tabs/body parts/options on the edit page and on the viewed page could be a discussion. The fullwidth vs two-column question also raises the issue of layout/grid/frameworks/mobile for the back end.

page options - all open

@parndt
Copy link
Member

parndt commented Jun 22, 2014

I have to ask the question: "Is the pages form becoming too complicated, is there another way we can do this?"

@anitagraham
Copy link
Contributor Author

I don't think this pull request makes the form too complicated. It breaks the Advanced Page Options up in a way that is more logical (SEO is a separate plugin, although an internal one) and it gives plugins controlled access to that section of the form.

You and other experienced users of refinery might want to ask if other plugins are likely to need a per-page options setup.

@bricesanchez
Copy link
Member

Could we use tabs instead of hide/show effect ?
By the way, splitting Advanced page options is a good idea.

@anitagraham
Copy link
Contributor Author

That¹s possible. It will mean another row of tabs on the page
(page_part tabs and options tabs). I will try it out and see what it looks

like.

Anita Graham
anita@joli.com.au

From: Brice Sanchez notifications@github.com
Reply-To: refinery/refinerycms
<reply+i-36217748-8b224c9833d4542d5e76023a70bcb6a3cf4dbbda-397118@reply.gith
ub.com>
Date: Friday, 22 August 2014 8:51 pm
To: refinery/refinerycms refinerycms@noreply.github.com
Cc: Anita Graham anita@joli.com.au
Subject: Re: [refinerycms] Extend page options (#2619)

Could we use tabs instead of hide/show effect ?
By the way, splitting Advanced page options is a good idea.


Reply to this email directly or view it on GitHub
#2619 (comment) .

@anitagraham
Copy link
Contributor Author

Just a couple of screen shots of page options as tabs.
Closed
page option tabs closed-small
Open
page option tabs open-small

@simi
Copy link
Member

simi commented Dec 28, 2014

I like tabs solution.

What`s current status of this PR? @parndt

@parndt
Copy link
Member

parndt commented Dec 28, 2014

I wasn't sure about the introduction of an API for adding page options as it seemed like another point of coupling to the pages extension, but it is probably a step forward instead of having "special cases" like SEO as noted by @anitagraham

@anitagraham
Copy link
Contributor Author

Hi Phil,

I have never been clear about what Refinery will look like when the pages
extension is decoupled.

What is your vision for this?

Anita

@parndt
Copy link
Member

parndt commented Dec 29, 2014

@anitagraham I'm not talking about removing the pages extension, I was just wary of other extensions coupling to it. But I think it's probably better than the hardcoded hacks we have!

@parndt
Copy link
Member

parndt commented Dec 29, 2014

I think we should try to get this feature merged.

Plugins can specify a page-options template to use
Add new attribute to Refinery::Plugin for plugins to register their
page_options template.
@simi
Copy link
Member

simi commented Dec 29, 2014

Refinery 4 candidate?

@duarme
Copy link
Contributor

duarme commented Jan 9, 2015

Wow, I was just starting a feature request for this! 👍

@duarme
Copy link
Contributor

duarme commented Jan 9, 2015

I also think there should be a way to associate extension (with their page-tabs and advanced options) to view templates.

For instance: what if I want only a couple of testimonials displayed in the home and a couple more in the contact page and I have a website with hundreds of other pages?
Shouldn't there be a way to say "I want the testimonial admin machinery to appear only on pages with the 'home' or 'contact' template"?

@anitagraham
Copy link
Contributor Author

Wrote a reply / reread what you wrote / deleted reply.

I have written a PR which does a similar thing. I don't think I have links to view-templates though and it is aimed more at front-end changes than back-end.
#2615 and #2636 include some discussion of the ideas.

@anitagraham
Copy link
Contributor Author

Closing this PR as it hasn't moved forward for a long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants