Maybe I'm missing something, but it seems as though panopoly_widgets is adding some default content (image, video, spot light, and basic file) so that if we don't specify our own, these will be populated when adding new content. We would like to not have these when users are adding, say, an image pane -- in other words, they shouldn't have to remove a default image before adding their own. Maybe this could be in a 'default content' app rather than in the widgets app itself? Similarly with the default text that appears in all of the pane types. I know I can edit this with my own defaults (and remove the text,) but it would be much more convenient to not have to.

Thanks, Panopoly truly is a great addition to Drupal!

Comments

populist’s picture

Assigned: Unassigned » beeradb

You mean you don't like the crazy vegetables? Fair enough.

The work here is to:

1.) make a setting on panopoly widgets that decides if demo content will be used

2.) use that setting where the demo content is being added

The default can be on, but can be disabled when/if needed.

beeradb’s picture

Status: Active » Needs review
StatusFileSize
new19.71 KB

Let's give this patch a go.

This patch does a handful of things:

* Add a setting to determine if the use wants to use demo content (Defaults to on).
* Removes default values from the panopoly_widgets field definitions.
* Adds an implementation of hook_field_widget_form_alter which checks the user setting and sets the #default_values. I also had to (somewhat unfortunately) conditionally add stuff to the $form_state['values'] array to keep previews working correctly. It would feel cleaner to me if we could avoid this, but I didn't see an obvious way around it. We're also doing it elsewhere (fids, for instance).

beeradb’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev
StatusFileSize
new19.03 KB

Previous patch was malformed. Here's a (hopefully) better version.

populist’s picture

Status: Needs review » Fixed

Great. May the carrots be suggested, but not required.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.