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

Unattached files #78

Closed
davidbankes opened this issue Oct 16, 2015 · 1 comment
Closed

Unattached files #78

davidbankes opened this issue Oct 16, 2015 · 1 comment

Comments

@davidbankes
Copy link

I'm interested in the ability to have generic media library functionality where files could be uploaded to the library and then later associated with an arbitrary models. Are you interested in having such unassociated files at some point in the future? I’d love to contribute if that’s a feature you would consider.

Here’s the use case I want to build:
Client has uploaded an image in the past, either directly to the media library (unattached to a model) or to a e.g., blog story. Now, adding a new portfolio case study, instead of uploading a new image, the client would also have the ability to choose any image in the media library. Selecting such an image would make a copy in the background just for the case study, and attache the copy to the case study model.

For this to work best, I think it might be useful to have the media library be able to function as an independent set of files, rather than only as a set of attached files. The media Library in Wordpress, for example, displays this sort of behavior.

Thanks!

@freekmurze
Copy link
Member

This package is build entirely on the idea of files being associated with models.

To create the behaviour that you want I'd create a table called MediaGroups or something similar. A MediaGroup has a name and can contain one or more Media-items. Think of it as a sort of directory. All uploaded media must be related to a MediaGroup.

To associate the media items with the real content you could use your own media model and use a polymorphic relation.

I think providing MediaGroups (or MediaTree would be a more appropriate name if nested set would be used) isn't a responsability of the package. But it could be a package in its own right.

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

No branches or pull requests

2 participants