I have a Drupal 8 site for a client. I was in need of a way to allow them to easily link to managed files. I was recommended Linkint by a colleague who used the module all the time for Drupal 7 sites.
The description sounded fantastic. When I got it all set up and starting testing it, I realized when linking to files, the links were to the rather useless file entity page, not to the actual files themselves.
I've been doing research on this for two days, trying to find a solution. I found a thread for the Drupal 7 version of the module that was about this exact issue, and it had looked like this feature had been rolled into that version.
Am I missing something, some setting somewhere, either in Linkit, or in the file entity module? Is there anyway (even modifying module files, if I have to) to change the behavior to link to the actual file (such as a PDF or DOC file) rather than to the file entity page, which, out of the box in D8, doesn't even have a proper link to the file.
Thank you for any help you can offer,
Nathaniel



| Comment | File | Size | Author |
|---|---|---|---|
| #6 | linkit_file_entity_link.patch | 649 bytes | audriusb |
| #5 | CKEditor Link Settings.jpg | 96.09 KB | gmclelland |
| #5 | linkit-settings.jpg | 184.28 KB | gmclelland |
Comments
Comment #2
nkraftComment #3
anonSorry for late response.
Linkit 4.x and 5.x (both for D8) is linking directly to the files if you not using
file_entity.File entity alters the file path, so if they have some way to point directly to the file, we could do something like we did in Linkit 3.x.
Comment #4
anonFile entity module for drupal 8 is in beta. I tested it on 8.1.3 and it is has many major bugs.
Tho, when its ready, I think we should integrate with it, as I think many sites will use it.
Comment #5
gmclelland commentedFor 7.x, I'm using Linkit 3.x with Media 2.x, File Entity 2.x, and https://www.drupal.org/project/ckeditor_link and https://www.drupal.org/project/ckeditor_link_file.
Note: just because the modules are labled ckeditor_... doesn't mean you have to use ckeditor. I'm using TinyMCE.
Those modules allows me to use Linkit to insert links to the file entity page which ckeditor_link_file then converts those links with an input filter to link directly to the files. ckeditor_link_file module also adds file usage so when I view the file entity usage, I can see which nodes link to that file. (Very helpful feature)
There is also a new module https://www.drupal.org/project/linkit_picker_file, but I haven't tested that to see exactly what it does.
I attached screenshots of the settings I use.
Hope that helps
Comment #6
audriusb commentedWe made a patch since we need this fucntionality now. Attaching it if someone else needs.
edit: make sure you have File matcher added to Linkit profile.
Comment #7
gmclelland commentedPatch attached. Setting to NR
Comment #9
anonThe patch fails as its created in the wrong directory. Its created in the site root, should be linkit root.
Also, we can't force this behavior. it should be a setting in the file matcher.
A test for this is also needed.
Comment #10
ashopin commented#5 worked for me but I had to patch manually since the function names don't match.
Comment #11
svenvdv commentedAny progress on this?
Comment #12
anonYes, this works in 8.x-5.x now.
Comment #13
mlncn commentedIf this works in Drupal 8 can we document how? Not able to get linkit to autocomplete Drupal core media module file paths at least.
Comment #14
megakeegman commentedYou just have to configure the linkit profile, adding a matcher for media entities. EDIT: Oh and you have to first enable "Standalone media URL" in media settings config.
Comment #15
mark_fullmerI understood this question somewhat differently than the answer provided in #14. Here's the documentation based on how I understand the question:
https://www.drupal.org/docs/extending-drupal/contributed-modules/contrib...
If this documentation should be updated or supplemented, please feel free to contribute!
Comment #16
mlncn commentedSo sorry for the noise— yes, Mark, that is exactly the documentation i needed! Thank you so much!