Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am using search core web part to display the results of my search. I have added a column in xslt so that it displays ProjectId in the search result. I am using BCS to search an external database. I would like to make projectid a link. the url of this project is stored in a list called referenceList.

Here is an exmaple:

**SQL Database table:**

**ProjectId | Project Name | Project Description** 
----------------------------------------------
1           Proj 1         some description
2           Proj 2         some other description

**Referencelist (in sharepoint)**

ProjectId | ProjectUrl
---------------------------
1         | http://google.com
2         | http://gmail.com


Results in Search Core Web part
---------------------------------
ProjectId <Link> | Project Name | Project Description 

What is the best way to retrieve the projecturl in ReferenceList (custom list) from within the xslt in Search core web part? Can I use xslt list view web part? at the moment I am modifying the xslt of the search core web part.

Can you provide me some examples or references or ideas as to how can I do this?

Thank you very much. Please it is urgent.

share|improve this question
    
What about storing Project Url in the SQL database? –  Kai Mar 21 '13 at 12:50
    
No I cannot do that. No extra columns can be created in SQL. It has been decided like this. So the url has to be store in SharePoint list and retrieve it from there. –  Helm Ifort Mar 21 '13 at 15:28
add comment

1 Answer

If I am understanding correctly, the data is unrelated as far as search is concerned as it is coming from two different places. This means you will not be able to achieve this simply using XSLT.

You could possibly embed some jQuery in your results page which gets the URL from the related list using SPServices or REST.

share|improve this answer
    
Hi Dave, the only relationship between search results and custom list is the ProjectID. They both have a common project id. So I was wondering what will be a good way to retrieve the information in the custom list based on the projectId that the search result returns back. The information that I retrieve from custom list has to be displayed in the search result. So it is like kind of joint. –  Helm Ifort Mar 21 '13 at 12:03
    
OK - so as suggested above it sounds like SPServices or REST is the way to go. I would probably use XSLT to format the output you want including a placeholder for the URL then have a jQuery script loop through the results, getting the URL using REST or SPServices and then writing to the relevant placeholder. Good luck. –  Dave Paylor Mar 21 '13 at 21:26
    
Yes I am using xslt of the Search core web part. So, is it possible to use the object model inside the xslt web part to look up the columns in the custom sharepoint list? –  Helm Ifort Mar 22 '13 at 11:00
    
XSLT is server side and jQuery is client side so as suggested above I would do one and then the other. –  Dave Paylor Mar 22 '13 at 12:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.