Wrap it in a tag.. I recon :) also name the icon the same as the
extension.. e.g.
pdf.gif
doc.gif
gif.gif
xls.gif

you get the idea  and then you can do one of the funky get extension
functions and just ask for #exstension#.gif

On Fri, 6 Aug 2004 09:55:56 +0100, Ian Vaughan
<[EMAIL PROTECTED]> wrote:
> How could I display an icon based on the suffix of a file in Coldfusion
> ?
>
> For example from the following output from a cfquery
>
> <a  href=""> > <http://intranet.neath-porttalbot.gov.uk/itintranet/itdocuments/document
> s/#docpath#">#doctitle#</a> >
>
> If the file name in docpath was for example sample.pdf - a PDF icon
> would display next to the doctitle
>
> If the file name in docpath was sample.doc - a MS Word icon would
> display next to the doctitle etc
>
> How would this be achieved in Coldfusion using by using CFIF below ??
>
> <cfif getdocs.docpath EQ ".pdf">
> <a  href=""> > <http://intranet.neath-porttalbot.gov.uk/itintranet/itdocuments/document
> s/#docpath#">#doctitle#</a> >
> <img border="0" src=""> > <http://intranet.neath-porttalbot.gov.uk/images/icons/pdficon.gif> "
> width="32" height="33">
>
> <cfelseif getdocs.docpath EQ ".doc">
> <a  href=""> > <http://intranet.neath-porttalbot.gov.uk/itintranet/itdocuments/document
> s/#docpath#">#doctitle#</a> >
> <img border="0" src=""> > <http://intranet.neath-porttalbot.gov.uk/images/icons/pdficon.gif> "
> width="32" height="33">
>
> </cfif>
>
> or is there a more efficient approach ?
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to