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

Currently, my Search Core Results display the following information: Contact us Africa, Least Developed Countries and Special Programmes … Your e-mail (required and never shared) … …  Date: 6/11/2012 Size: 73KB http://[root]/delegate/Pages/Feedback.aspx

I would like to replace the "Date" which seems to be coming from the "last modified" information by a custom Publish date field from a SharePoint form, say "DateOfPublication". Is this feasible? If so, can anyone show me how to do this? I have limited XSLT knowledge...

share|improve this question
add comment

2 Answers 2

Yes you can do that but you need to modify the XSLT of your search core results web part.

So, first of all, you can use the following XSLT to see your result in XML:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > 
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" /> 
  <xsl:template match="/"> 
    <xmp>
        <xsl:copy-of select="*"/>
    </xmp> 
  <xsl:template>
</xsl:stylesheet>

then you need to modify the xslt. If you want you can following this post: http://salvatoredifaziosharepoint.blogspot.it/2012/04/how-to-modify-sharepoints-result-page.html

share|improve this answer
add comment

If you use a custom property you would need to add that property to the Search Results before being able to use it in XSLT. But before you do that actually you need to make it a Managed Property (via Central Admin - Search Service application), see here http://technet.microsoft.com/en-us/library/ff621097.aspx

Afterwards, you could change what properties are available in the Core Search Results by following this http://msdn.microsoft.com/en-us/library/ms560074.aspx. Basically in the Search Core Results the xml element in the ToolPart needs to also contain your custom property. Then using something similar to Salvatore's suggestion, as explained under http://msdn.microsoft.com/en-us/library/ms546985.aspx would enable you to understand what Fields are already returned and make sure yours is too.

Final step, make sure you find the original "Last Modified" field which should be actually "Modified" (see here for more of the actual Internal Names http://blogs.msdn.com/b/michael_yeager/archive/2008/11/03/reference-list-for-internal-field-names.aspx) and replace with your own Internal Name.

As a word of caution: it would be good to have Crawl executed before (after filling already some data in your list) so that your property gets indexed and added to the Crawled Properties.

share|improve this answer
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.