This selects the second attachment and displays it as a thumbnail link if it is
a jpg or gif and diplays a text link if it isn't. I don't remember exactly why
I have it picking the attachments one at a time, but change the last number
after selected file to 1 through however many.
This is out of a show as html view column, but it works pretty much the same in
computed fields.
Is this what you want?
This selects the second attachment and displays it as a thumbnail link if it is a jpg or gif and diplays a text link if it isn't. I don't remember exactly why I have it picking the attachments one at a time, but change the last number after selected file to 1 through however many.
This is out of a show as html view column, but it works pretty much the same in computed fields.
I am sure there is a more elegant way to do this.
--dan SelectedFile:=@Word(@Implode(@AttachmentNames); " ";2); ANames:=@ReplaceSubstring(SelectedFile;" ";"+"); ANames2:=@ReplaceSubstring(SelectedFile;" ";"_"); DBName := @ReplaceSubstring(@ReplaceSubstring(@Subset(@DbName; -1);" ";"+");"\\";"/"); open:="?OpenElement"; view:=@ReplaceSubstring(@ReplaceSubstring(@Subset(@ViewTitle; 1);" ";"+");"\\";"/"); docid:=@Text(@DocumentUniqueID); url:="{<a href=/"+dbname+"/"+view+"/"+docid+"/$FILE/"+ANames+"><img src=/"+dbname+"/"+view+"/"+docid+"/$FILE/"+ANames+" WIDTH=200 Hspace = 20 Vspace=20 border=2 ALT="+ANames2+"></a>}"; url2:="{<br><a href=/"+dbname+"/"+view+"/"+docid+"/$FILE/"+ANames+">" + SelectedFile + "</a><br>}"; @If(SelectedFile = NULL;NULL; @Ends (@LowerCase(SelectedFile) ; "gif" ) ; url; @Ends (@LowerCase(SelectedFile) ; "jpg" ) ; url; url2)