0

Is there anyway to remove these links from the output of the media module? I suspect that they're responsible for breaking the link tag I have wrapped around the Media image in the WYSIWYG editor.

On the rendered template of the page this looks like

enter image description here

How can I prevent these links from being embedded by the media module? They even appear to show when I am not logged into the Drupal administration too.

3 Answers 3

1

You'll have to change the sort order of filtering within your text format, admin/config/content/formats/full_html (for Full HTML text format). Just place the "Convert media tags into markup" before the "CKeditor Link filter".

1
  • We're not using CKeditor.
    – Treffynnon
    Commented Nov 7, 2014 at 13:20
1

There is a patch here https://www.drupal.org/node/2401811

This behavior is a regression introduced by another patch that may well get rolled back.

0

I posted this as an issue on the media_wysiwyg module bug tracker over at https://www.drupal.org/node/2357993 and have been working my way through it since. Here is the best result I have managed to achieve so far copied from my responses to that issue.


This issue is mostly caused by the file_entity module. To work round this I have restricted the view modes available to media_wysiwyg in /admin/config/media/wysiwyg-view-mode. I have set images to only allow the WYSIWYG view mode like so:

Media WYSIWYG editor

I have then created an override template for the file entity called file--image--wysiwyg.tpl.php (see https://www.drupal.org/node/1793548) and I have the following code in it:

<?php

hide($content['links']);
print render($content);

This has now removed all the annoying links, headers and wrapping <div>s from the output EXCEPT for the media_wysiwyg wrapping mentioned in comment #4.

As this is just one wrapping <div> and the page is HTML this now no longer breaks the link, but it would still be preferable to be able to remove this annoying wrapping <div>.

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.