Hi,

I have a use case where my content type contains a file field,

However the file field can contain different type of files: doc, pdf, xls, ppt, etc.

I'd like to just have the PDF embed render when the file is a PDF file, otherwise it falls back to a default field formatter (a link).

Please see my patch and if this could help others it would be great!

CommentFileSizeAuthor
file_type_check.patch1.12 KBxcf33

Comments

victorcoder’s picture

Status: Active » Closed (won't fix)

Mmm this renderer is only for PDF files, you can limit possible file uploads in field config and add another field for different filetypes.

I can't include the patch because if you upload other filetype you can not configure the renderer to use as pdf renderer is already selected.

Thanks