Forums: How to display icon instead of file name on the list page - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to display icon instead of file name on the list page

#1 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 8453
  • Joined: 03-February 03

Posted 12 September 2009 - 08:00 PM

To make this work you need to create a set of images for supported document types and save them somewhere on your web server. Then you can set 'View as' type of the field that stores file name to 'Custom' and build the code that displays an icon with the link to file.

Example:

if right(strValue,3)=".doc" 
 then icon="word.gif"
else if right(strValue,3)=".xls" 
 then icon="excel.gif"
end if

strValue = "<a href='files/" & strValue & "'><img border=0 src='images/" & icon & "'></a>"


This examples assumes documents are stored in files folder while document images are stored in images folder.
Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users