Using Kentico MVC, I would like to add a new field in my page type to select the GUID of a media in order to generate something like: /getmedia/ff30e190-1784-4cbc-8718-f16f3c570535/Colombia-Coffee.jpg
. I know that you can have a GUID data type field for selecting pages but nothing, to my knowledge, for media.
In my situation, I have several big Excel files in only one language that I don't want to load as an attachment or a file as I don't want them to overload the CMS.Attachments
table for some documents which won't even be used in the smart search. It has to stay on the file system and so Media libraries seem to be a good compromise. However, I don't see how to attach media to a page using a dedicated field in a way I could then do API manipulation (easily extract Title, size, etc...)?
Thank you for your help
Sylvain
Have you tried Object selector form control? you could specify what object you'd like to select (media.file in your case I believe) as well as you could configure what column you'd like to return. This method won't be as much convenient as URL selector for example, as it would list all media lib files not organized in folders.
If Object selector is not available for GUIL field type you could adjust it going to Form Controls -> Object selector and play around with its settings.