Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
when I inserted a pdf file for example in the editor I always get
<img src="http://monsite.com/sites/all/modules/custom/media/images/icons/default/application-octet-stream.png" typeof="foaf:Image" class="media-image" alt="">
but I want to display the file name with a link
when i change the file display
admin/config/media/file-types/manage/default/file-display
i get only the icon pdf
Thank you
Comments
Comment #1
zied.ellouze CreditAttribution: zied.ellouze commentedComment #2
Dave ReidComment #3
doostinharrell CreditAttribution: doostinharrell commentedThis appears to still be an issue however it is resolved when you save the node a second time. What's strange in my case is that when you initially create a node the media markup looks differently than when you go to edit the node for the 1st and different again the 2nd time.
---
Here is what I'm seeing when I first embed the file (prior to saving)
<p>[[{"fid":"10283","view_mode":"teaser","fields":{"format":"teaser"},"type":"media","field_deltas":{"1":{"format":"teaser"}},"attributes":{"class":"file media-element file-teaser","data-delta":"1"},"link_text":false}]]</p>
Only the file icon is displayed, not icon text, no link.
---
Here is what I'm seeing when I edit the node the 1st time
<p>[[{"fid":"10283","view_mode":"teaser","fields":{"format":"teaser"},"type":"media","field_deltas":{"1":{"format":"teaser"}},"link_text":null,"attributes":{"class":"file media-element file-teaser","data-delta":"1"}}]]</p>
The link works as expected. I see the icon, the text, and everything is wrapped in a link.
---
Here is what I'm seeing when I edit the node a 2nd time
<p>[[{"fid":"10283","view_mode":"teaser","fields":{"format":"teaser"},"type":"media","field_deltas":{"1":{"format":"teaser"}},"link_text":"SampleReqForm.pdf","attributes":{"class":"file media-element file-teaser","data-delta":"1"}}]]</p>
---
Hopefully this sheds some light on the issue.
Comment #4
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedClosing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team