-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Extend page options #2619
Conversation
Plugins can specify a page-options template to use
Add new attribute to Refinery::Plugin for plugins to register their page_options template.
@ugisozols what do you think? |
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. |
@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 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. 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. |
I have to ask the question: "Is the pages form becoming too complicated, is there another way we can do this?" |
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. |
Could we use tabs instead of hide/show effect ? |
That¹s possible. It will mean another row of tabs on the page like.Anita Graham From: Brice Sanchez notifications@github.com Could we use tabs instead of hide/show effect ? ‹ |
I like tabs solution. What`s current status of this PR? @parndt |
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 |
Hi Phil, I have never been clear about what Refinery will look like when the pages What is your vision for this? Anita |
@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! |
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.
…refinerycms into extend-page-options
Refinery 4 candidate? |
Wow, I was just starting a feature request for this! 👍 |
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? |
Closing this PR as it hasn't moved forward for a long time. |
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)
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