Hi Chaps,
Thankyou for your efforts on the JDOM, but this didn't work for me. I ended up with the text link again and no icon.
I wanted a pdf/file icon in the grid view - which when clicked would download the pdf.
But the dataValue attribute was a good tip - so I worked off that to develop my custom code...
if ($row->datasheet_pdf <> null){
$link = "<a href='components/com_sqid/files/devices_datasheet_pdf/".$row->datasheet_pdf."'>
<img src='components/com_sqid/files/datasheet-icon.png'>
</a>";
echo JDom::_('html.fly.file', array(
'dataValue' => $link,
'height' => 'auto',
'indirect' => false,
'preview' => 'modal',
'width' => 'auto'
));
}
And this is what I get...
When we click on icon, the file downloads.
I had to hardcode the path for my component ("components/com_sqid/files/devices_datasheet_pdf"). I wanted to avoid that.
How do I call up the path of [DIR_DATASHEETS_IMAGE] ?