Question

I'm wondering how to correctly use the IconFile property of a TabInfo object in DotNetNuke? I am building a custom overlay menu that will be displaying the tab name, description, and an icon similar to the Admin and Host pages that use the 'console' DesktopModule. If I have a TabInfo object that has an IconFile set for it the value of the IconFile field is something like 'FileID=83'. I'm assuming this needs to be run through some sort of File API to determine what the URL of the file is.

Was it helpful?

Solution

The IconFile property of the TabInfo object returns the filename of the image associated with that TabInfo. This filename source is relative to the Portal root directory and therefor simply needs to be prefaced with PortalSettings.HomeDirectory to get the image source relative to the site root.

<img src="<%=PortalSettings.HomeDirectory %><%#Eval("IconFileLarge") %>" 
width="124" height="88" alt="" />

OTHER TIPS

DotNetNuke.Services.FileSystem.FileController has a method called GetFileById that accepts a File ID and a Portal ID. This returns a type of FileInfo which has both PhysicalPath and RelativePath properties.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top