0

We're relying on the Media module heavily for embedded video throughout our site. When Media is used for a field, it is working beautifully for us.

We ran into problems, however, embedding Media rich text fields. We're using CKEditor, which strips Media tags when using filtered HTML. For security purposes, we want all non-admin users to continue using filtered HTML. There were other complications, too: The UI was a little strange since you had to add the (non Media) image button to allow users to align images. So they'd have two image-y buttons, one to upload and one to style. Finally we decided we could keep rich text pared down to text without images.

However we've also been using Media to upload files (documents/docx/pdf). And we definitely want users to be able to link to files in the editor. Should we use CK Finder? Or is there a way we can expose the view at admin/content/file to non admin users so they could have an inventory of files and copy urls? Or rebuild a similar view, as described here?

I feel like I must be overlooking something obvious, as this seems like a very basic CMS feature... Have I managed to obscure functionality with my permissions and plugins? Thanks!

2 Answers 2

1

You should try using the node reference (References) module and create a field on your content type. The node reference will ask you to specify a content type that allows users to select from a list of previously created content. You can also create a view which you can select as the source for the select list.

https://drupal.org/project/references

2
  • Aha, so we're already using images that way and it works well. If it's a file used in the same way, where would a user go to create the node (upload the file) in the first place? Is there an interface I'm not seeing for that?
    – Beatrice
    Dec 19, 2013 at 15:14
  • You can create a new 'content type' called 'Video File' or 'Document File' and allow them to upload files. Then on your content nodes create a node reference that can reference the uploaded/published file nodes in that node. Then you could create a view block with an argument that displays the referenced node on pages with a reference. Or you could just print the referenced node to your preference using a content type template file using $node->{'_field_referenced_file'}.
    – CarlosM
    Dec 19, 2013 at 18:24
0

For this functionality, we ended up building custom views. It's actually not very difficult, since file entities (even uploaded through Media) have a slew of fata you can populate the view with. Filter by logged in user, and it works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.