I recently stumbled upon a small Plone add'on which improves the file view/download template in Plone. mainly to fix pdf's showing inline instead of always being offered as a download. But I cannot find it again. It had a non obvious package name, it's not rer.downloadurl, but something else.
Been searching for 45 minuts, on this forum as well, but cannot find it again. Let's try some community memory, anyone?
That is one of various projects that I did over the years but never got around to transferring to the collective and uploading to PyPI. If anyone's interested in doing that with this one, feel free!
Oh, this would be very useful!
I'm not familiar with the process to transfer to the collective and upload to PyPI
Can it be used as is from github?
thx very much!
Is there anything new on this topic?
I noticed that there should actually be a fix for PDFs:
/backend/lib/python3.9/site-packages/plone/namedfile/browser.py
And even in the backend, only after a whole series of clicks do I get to a URL that provides me with information about content disposition: curl -I http://localhost:8080/Plone/publication/paper/2303-03126.pdf/view /++widget++form.widgets.file/@@download/2303.03126.pdf
I actually thought I understood how it works by now, but unfortunately it still doesn't work like I thought.
What I have found out is that there is a difference between the state when you are logged in and when you are not logged in. I wasn't aware of that before.
Specifically, I have now even been able to see this on https://demo.plone.org without changing anything in the view.
I uploaded a PDF and then created a link to it. As long as I'm logged in, when I click on the link, the file object is displayed first. If I log out, the URL of the link is expanded by /@@download/file and I can download the PDF...
So far so good and understandable, but the approach of changing the content type file or its view in the ZMI, or as I thought changing the alias of the view of the content type file to @@display-file doesn't work.
I suspect that Volto may not even take these changes from the backend into account, which again brings up the question of how can I change @@download to @@display-file in Volto?
Do I perhaps need to change the UniversalLink:
node_modules/@plone/volto/src/components/manage/UniversalLink/UniversalLink.jsx
There the URL is checked for internal or external and external links then get the extension @@display-file
The question now would be whether it is worth the effort to also include the check for config.settings.viewableInBrowserObjects for internal links?