I need some help getting the LinkText set;
I'm trying to create a product selector that returns a hyperlink. I've created my own content provider, based on the ProductBrowserContentProvider. It's shows a list of products whom I generate in the ResolveDirectroy function shown in the code below. This works quit nice.
What is returned is a link to my product. It shows the link in the HyperLink Manager window, in both the URL and the LinkText fields.
But I would like to show the productname in the Linktext.
Is it at all possible to control the link text from something inside a FileItem object?
If not, what do I do to get the linktext to show what I want?
thanks
I'm trying to create a product selector that returns a hyperlink. I've created my own content provider, based on the ProductBrowserContentProvider. It's shows a list of products whom I generate in the ResolveDirectroy function shown in the code below. This works quit nice.
What is returned is a link to my product. It shows the link in the HyperLink Manager window, in both the URL and the LinkText fields.
But I would like to show the productname in the Linktext.
public override DirectoryItem ResolveDirectory(string path) |
{ |
// category |
DirectoryItem[] directories = GetChildDirectories(path); |
return new DirectoryItem(GetName(path), EndWithSlash(GetDirectoryPath(path)), path, "", _permissions, GetChildFiles(path), directories); |
} |
private FileItem[] GetChildFiles(string path) |
{ |
List<FileItem> products = new List<FileItem>(); |
long categoryid = GetLastIdFromPath(path); |
if (categoryid > 0) |
{ |
ProductFilter filter = new ProductFilter(0); |
filter.Category = CategoryManager.FindCategory(categoryid); |
foreach (Product product in ProductManager.FindProducts(filter)) |
{ |
string url = "http://${baseurl}/productdetails.aspx?id="; |
url += product.ProductID.ToString(); |
url += "&username=${username}&password=${password}"; |
// the linktext should be product.TitleActiveLanguage |
FileItem product_item = new FileItem(product.GetTitle(Framework.ActiveLanguage, true, true, false, false),"", 0, "location", url, product.TitleActiveLanguage, _permissions); |
products.Add(product_item); |
} |
} |
return products.ToArray(); |
} |
Is it at all possible to control the link text from something inside a FileItem object?
If not, what do I do to get the linktext to show what I want?
thanks