Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Displaying Image in Smart Search Results View modes: 
User avatar
Member
Member
paul.truman-sunmed.co - 11/4/2012 12:36:23 PM
   
Displaying Image in Smart Search Results
Hey, I'm using the following code to reference an image in the smart search results, but I keep getting compiling errors saying that it can't find the reference in CMS.FileManager. I've referenced Using CMS.FileManager; but I'm still getting the error. Anyone got any ideas where I'm going wrong?
public static string getFileImage(object inputGUID)
{
Guid guid = CMS.GlobalHelper.ValidationHelper.GetGuid(inputGUID, Guid.Empty);
if (guid != Guid.Empty)
{
string url = CMS.FileManager.AttachmentManager.GetAttachmentUrl(guid, "picture");
return "<img alt=\"" + "alternative text" + "\" src=\"" + url + "\" border=\"0\" />";
}
return "";
}

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/7/2012 5:10:54 AM
   
RE:Displaying Image in Smart Search Results
Hi,

Where exactly and when are you using this code?

Best regards,
Juraj Ondrus

User avatar
Member
Member
paul.truman-sunmed.co - 11/7/2012 5:16:22 AM
   
RE:Displaying Image in Smart Search Results
Hi, I've created a class for a custom function, like in the custom transformation explaination for MyFunctions.cs

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/8/2012 7:41:36 AM
   
RE:Displaying Image in Smart Search Results
Hi,

Thank you for the details. However, which version of CMS do you use? This forum is for version 6 and the AttachmentManager was moved to CMS.TreeEngine namespace.

Best regards,
Juraj Ondrus