November Happy Hour will be moved to Thursday December 5th.

How to customize the built-in search function?

Vote:
 
I need to customize the built-in search function so that when searching for documents the URL in each item of the returned result list is based on a return value of a function. By looking at Search.ascx I see that "Container.CurrentPage.DetermineAutomaticURL(Container.CurrentPage.LanguageBranch)" is what grabs the language specific URL of the current page item. I need to implement the code below to change the URL to the one for the document file if the page in the resultset doesn't have children. This should return the URL string based on the condition: protected string GetLink(PageData pd) { if (GetChildren(pd.PageLink).Count >= 1) { // if there are children pages don't change anything return string.Format(_link, pd.LinkURL, "_self", pd.PageName); } else { // if there are NO children pages point directly to document return string.Format(_link, pd.Property["varFilePath"], "_blank", pd.PageName); } }
#13290
Nov 30, 2007 14:01
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.