Hello,
how about using a custom field? Take a look.
- Create a field from menu option and name it as “pdf”
- Click over the field recently created and put the following logic in the onExecute() event:
// image to display if not pdf is found
$imageUrl = 'http://example.com/notFound.png';
// assuming that there is a column called "pdf_file_url" then:
$pdfUrl = [pdf_file_url];
if ($pdfUrl != null && $pdfUrl != ''){
// pdf exists, then show the link
{pdf} = '<a href="'. $pdfUrl .'">' . $pdfUrl . '</a>';
else{
// show the not found image
{pdf} = '<img src="'. $imageUrl . '" />';
}
- Go to Edit Fields in menu option and drag “pdf” field to drop it inside of shown fields section.
Now, your grid will have an additional column showing the image or the pdf link according to the case.