Skip to content

Conversation

@westonruter
Copy link
Contributor

It would be great if the great new widgets UI you're working on could be embedded within in a lightbox window that appears over the window when using the customizer (just like when you open the media manager). Widgets could then be dragged into the relevant customizer sections in the customizer panel (each sidebar could have its own section), and the preview window could then update to show the user what the site looks like with that widget added.

  • Expand the widget control when it is first added to the sidebar.
  • Prepend the added widget to the existing widgets added to the sidebar. (Need to prepend the widgets_sidebars setting.)
  • Is WordPress keeping track of the multi_number outside of the widget form?
  • Don't invoke the widget save option when first adding a widget (to avoid error messages).
  • When removing a single widget, make option to add the widget enabled again.
  • Fix restoring of single widgets (has initial previewing state, and instance override does not work since control looks at $_POST)
  • When initially adding a widget, make sure it will appear in the preview even before saving.
  • When adding a single widget which previously existed (and is now in inactive sidebar), the old instance should remain.
  • Refactor all of this to eliminate PHP 5.3 dependencies
  • Remove pre-preview filters once customize_register happens
  • Refactor option transactions into separate class.
  • What is wrong with adding the RSS Feed widget?
  • Adding or reusing nonces for security? (e.g. in preview_new_widgets)
@westonruter
Copy link
Contributor Author

See also the following customizer concept from the Widgets UI Refresh, featured in the Aug 26, 2013 meeting summary:

image

@westonruter
Copy link
Contributor Author

See also my concerns about the above concept, specifically the "Select a template to add widgets to" part.

@westonruter
Copy link
Contributor Author

I just realized a compact UI for adding widgets the Widget Customizer: as part of the (hidden) control for storing the widget orders, we could also include a drop-down of all registered widgets along with a button to add. Clicking add would insert a new widget form control at the top of the list, after which it could then be dragged to its desired location (see #1).

@shaunandrews
Copy link
Contributor

Another idea for adding widgets by hovering in empty spaces in an area:

screen shot 2013-09-27 at 12 03 13 pm

@bobbravo2
Copy link
Contributor

@westonruter I was initially thinking this made sense as an additional control - however - the SRP dictates that there be two separate controls: one for adding new widgets, and another to control widget preview order.

I'll give you some feedback on my thoughts RE: separate control for widget order on #14

@westonruter
Copy link
Contributor Author

@bobbravo2 sorry, what does “SRP” mean?

@westonruter westonruter mentioned this pull request Sep 28, 2013
@shaunandrews
Copy link
Contributor

Related to @westonruter recent comment on #16, here's a minor tweak that would work better with horizontally oriented widgets:

screen shot 2013-09-28 at 11 52 55 am

@westonruter
Copy link
Contributor Author

@shaunandrews so for horizontally-oriented widgets, would this ADD WIDET divider/button be rotated 90°?

@bobbravo2
Copy link
Contributor

@westonruter sorry... I'm an acronym geek..: SRP Single Responsibility Principal.

@westonruter
Copy link
Contributor Author

@bobbravo2 thanks 😄 So regarding SRP, I think what I worked on over the weekend makes sense. The new control is "sidebar widgets" and it is for the setting which is just an array of the widget IDs contained in the sidebar. So since the setting itself handles both the ordering of the widgets, and which widgets are contained in the sidebar, it seems the customizer control can also logically manage both the ordering and the adding/removing of widgets from sidebars.

I think it worked out quite cleanly, if you look at the changes on #1 and then how easy it was to add dragging between sidebars in #24.

@ghost ghost assigned westonruter Oct 14, 2013
@westonruter
Copy link
Contributor Author

I'm doing work in the issue-3-addition branch. Here's the initial UI for where a widget would be added to a sidebar:

customize__wordpress_develop___just_another_wordpress_site

@westonruter
Copy link
Contributor Author

Screenshot with the select dropdown opened:

image

@westonruter
Copy link
Contributor Author

I've reached a beta state for this widget addition feature.

@westonruter westonruter mentioned this pull request Oct 25, 2013
@bobbravo2
Copy link
Contributor

@westonruter love the drop down for adding new widgets - that's what I was hoping for. What do you think about adding the Chosen jQuery plugin to enhance it with search (search a widget's description / title / possible alternate keywords for new users)?

Chosen Demo
http://harvesthq.github.io/chosen/

@westonruter
Copy link
Contributor Author

@bobbravo2 yes, I'd love to add Chosen or Select2 to improve the usability of the dropdown. From the Chosen demo, I assume the Standard Select or the Standard Select with optgroup would be the field we'd be interested in? I guess too we'll want to let the autocomplete match not only the title of the widget, but its description as well?

westonruter added a commit that referenced this pull request Oct 26, 2013
Add support for adding widgets
@westonruter westonruter merged commit fd95075 into develop Oct 26, 2013
@westonruter
Copy link
Contributor Author

Well, that was an epic effort. So happy with how it turned out! 😆

@westonruter
Copy link
Contributor Author

To see the behavior for old-style single (non-multi) widgets, try this plugin which adds a test one: https://gist.github.com/westonruter/7141599

@jtsternberg
Copy link

+1 for Select2

fnakstad added a commit to knishiura-lab/wp-widget-customizer that referenced this pull request Feb 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4 participants