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

[DataViews] Reordering Items? #61751

Open
dannyreaktiv opened this issue May 16, 2024 · 5 comments
Open

[DataViews] Reordering Items? #61751

dannyreaktiv opened this issue May 16, 2024 · 5 comments
Labels
[Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond [Type] Enhancement A suggestion for improvement.

Comments

@dannyreaktiv
Copy link

What problem does this address?

Is there anything on the DataViews roadmap to include reordering items via drag and drop?

What is your proposed solution?

Allow for items be rendered via drag and drop. In Table view that would mean reordering rows and in Grid that would mean having the cards be reorderable.

@dannyreaktiv dannyreaktiv added the [Type] Enhancement A suggestion for improvement. label May 16, 2024
@jameskoster
Copy link
Contributor

I assume this would be a way to manipulate the order value for pages? What would it do on other data views like Templates or Patterns?

In general I'm not sure this is really compatible with the sorting functionality in data views. What happens if you sort by publish date then drag and drop to re-order?

It would be helpful to unpack the feature a little more if you have the time :) Why do you need drag and drop here?

@dannyreaktiv
Copy link
Author

@jameskoster Thanks for replying. I've got all the time in the world :)

The need is to have a component that provides an array of post IDs for a block to render the posts in a specific order. (Kind of like Query Loop with a $post__in )

  1. Allow users to select which posts they want.
  2. Allow users to reorder the posts.

DataViews is a beautiful component, so I was hoping to be able to leverage it.

@jordesign jordesign added the [Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond label May 20, 2024
@ntsekouras
Copy link
Contributor

I think it's more likely to have the ability to pin items, which could produce similar results with the behavior you're describing. Would that work for your use case?

@jameskoster
Copy link
Contributor

@dannyreaktiv my interpretation is slightly different to Nik's, I think. I want to fully understand.

It sounds to me that you'd like to have a block that shows a specific set of posts. In the configuration view for that block the posts are displayed using the data view component. Users can drag/drop posts to change the order that the block displays them in.

If that's correct, I'd ask; why not allow users to re-order on the canvas, similar to how images can be re-ordered in Gallery blocks? Otherwise I'm struggling to see a similar use case for core data views, so I'm not sure how it would fit into the roadmap.

@dannyreaktiv
Copy link
Author

@jameskoster Thanks for getting back to me.

I hadn't considered reordering on the canvas. Thanks for the idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants