Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Customizing Search Results for Custom Document Types View modes: 
User avatar
Member
Member
Armysniper89 - 4/2/2011 1:56:12 PM
   
Customizing Search Results for Custom Document Types
I have a custom version of Article that has a field which contains a URL to a "partner" who helped contribute an article. The same would be for our case studies (which is a document type similar to Article. We would love to show the "Partner URL" in our search results if the search results returns an Article or Case Study and the "Partner URL" field is not empty...how can I accomplish this in the Search Results Transformation?

User avatar
Member
Member
Armysniper89 - 4/7/2011 11:28:54 PM
   
RE:Customizing Search Results for Custom Document Types
So nobody can tell me how to get a field from a custom document type to display in a search result transformation if that custom document type in in the search results??

Would GetSearchValue work? Like this:

<%#GetSearchValue("Partner URL")%>

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 4/20/2011 9:04:41 AM
   
RE:Customizing Search Results for Custom Document Types
Hello,

Yes it will, the GetSearchValue function is the right way for your aim actually. Moreover, please take advantage of the IfEmpty function in combination with the SearchResultUrl one.
You can try to use the following expression:

<%# IfEmpty(GetSearchValue("PartnerURL"), SearchResultUrl(true), GetSearchValue("PartnerURL")) %>

Please note, it is only an example, therefore you will need to add the link HTML code etc.

Best regards
Ondrej Vasil