Gabriel Sure, so basically you would need to create a file _files/js/custom.js
, where you would add a custom contextmenu item.
https://www.files.gallery/docs/javascript-config/
Something like this:
_c.config = {
// custom context menu (dropdown) options
contextmenu: {
mylink: {
text: 'view freedm file',
icon: 'rotate_right',
condition: (item) => item.ext === 'freedm',
href: (item) => {
console.log(item.path, item);
return item.path;
},
},
},
}
Basically, you must add your link logic inside the href
function above, using the item
object parameters to generate your dynamic link. For instance, there is item.path
that contains the path to the file relative to the Files Gallery root
dir. This can be extrapolated to create your url.