Best way to insert inline links to downloads using block editor
-
In my sites, I have a lot of in-text links to PDF documents, like this: This is a PDF.
Using the classic editor, this was as simple as hitting the Add Media button and uploading the PDF through the media library pop-up. Quick and easy, and everything could be done without leaving the page/post.
Using the block editor though, it seems there are quite a few more steps. As I understand it, I have to first upload the document through the media library. Then I have to open the page/post, highlight the text, hit the Link button (⌘K), and search for the PDF by name to insert it. Alternatively, I could copy/paste the exact URL from the Media library.
Am I missing something here? Is there a quicker / easier way?
(BTW, I’m aware there is a File block that enables uploading and inserting downloads from within the editor, but that provides a whole preview/link/button combo thingy which is not what I’m after at all).
As a suggestion, maybe incorporating the Upload and Media Library buttons from the File block and adding them as options in the Link button could be a good solution? (something a bit like this maybe, or they could be hidden behind an additional control↴)

The blog I need help with is: (visible only to logged in users)
-
Hi! Just to check, do you find the PDF still embeds and button still appears even if you switch off their respective options in the file block? This is how it appears if I test:

-
Oh thanks @staff-95percentghost
I didn’t realise there was the “Show inline embed” control. That is pretty good.
The only downside of this solution as far as I can see is that the download needs to be it’s own block and therefore on it’s own line.
This won’t really work in my case, as I consistently have the PDF link on the same line as text (see, for example any of these pages 1, 2, 3 or 4) however I see how it would work for many others.
- The topic ‘Best way to insert inline links to downloads using block editor’ is closed to new replies.