Link to pdf in Documents. Is there a way the link for editors send to /view?

Hi!

In Plone Classic-UI, the Document content (RichTextField) can contain links to File objects. If the File is a pdf, it is useful for the Anonymous user to go directly to the pdf content in the browser (usually showing the pdf). I would like that links for Editors ("Can Modify") point to the file + /view, so they don't get the file but the standard view. In this way, it is easier for them to update files in the site. Otherwise, they have to go in folder_contents. search for the file. Being lazy, they usually modify the link uploading a new file, so the link is changed and the new file uploaded. But this mean the old file is left there, usually bloating folders and leaking stale content after a while.

How do you solve it? This apply also to plone 6.1 content browser but it could be easily solved with a "modify/replace this file" button when clicking on the current file, near to the select button. This button can send on the edit page of the file, so the user can just replace the file instead of uploading one..

In a zpt listing view, you have this section:

<tal:block tal:define="
    obj python:item.getObject();
    item_url python:item.getURL();
    item_id python:item.getId();
    item_title python:item.Title();
    item_title python:item_title or item_id;
    item_description python:item.Description();
    item_type python:item.PortalType();
    item_modified python:item.ModificationDate();
    item_created python:item.CreationDate();
    item_wf_state python:item.review_state();
    item_wf_state_class python:'state-' + view.normalizeString(item_wf_state);
    item_creator python:item.Creator();
    item_link python:item_type in view.use_view_action and item_url+'/view' or item_url;
    item_is_event python:view.is_event(obj);
    item_has_image python:item.getIcon;
    item_type_class python:('contenttype-' + view.normalizeString(item_type)) if showicons else '';
    ">

I would modify item_link python:item_type in view.use_view_action and item_url+'/view' or item_url; to do what you want.

I'm talking about links inside RichText fields, probabily PortalTransforms related.