8

There are excellent instructions for how to allow embedding Media into text fields here Setting up WYSIWYG and CKEditor to include Media Browser / Embed Media button.

Now I'm trying to control the output of that embedding process, specifically I'm trying to render a text field for a caption next to an image. I started out by adding a new view mode to the file entity with hook_entity_info_alter, configured this View mode to display the correct fields, and thought that would output as expected.

However, this by itself does nothing unless "File display" settings are also added, and I can't seem to figure out how to make them respect field settings. I've done a fair amount of debugging and hacking by now, and can't get this right. I could fill the question with a great deal of more details, but given that I can't make heads or tails out of the problem, it's unlikely to be very useful.

The question How do I control the file appearance using File Entity? is definitely related, and possibly even a duplicate, but as this one concerns specifically inline media, it may be different enough that open this separate question.

1

3 Answers 3

1

Your best bet is http://drupal.org/sandbox/DevinCarlson/1823634 - which is an add on to media, but I'm not certain whether or not it can also display fields that are attached to a file entity.

As per http://drupal.org/node/1792738 this functionality is planned to be rolled into the media module at some stage.

0

I'm not sure this is possible yet. See http://drupal.org/node/1421786 and http://drupal.org/node/1792738

0

I've dealt with this quite a bit (sometimes with varying degrees of success). Which version of Media are you using? 7.x-2.0-alpha3 includes Media WYSIWYG View Mode as a submodule, which allows you to select a view mode when inserting media into the WYSIWYG - so you can control the display however you like. For example, I have a view mode that includes caption fields, and I can select that when inserting an image.

I know it's only alpha, but many people have been using 2.x for a very long time - I've had it in production for over two years now, with no problems directly attributable to its not being an official release.

Your Answer

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

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