none
People Search Core Results alphabetically displayed

    Question

  • How can i do this?

    The webpart doesnt seem to have that option, can it be done via XSLT?

    What options are there?
    Monday, March 10, 2008 8:15 PM

All replies

  • Pedro,

    yes you can do that by using XSLT.

    The main part is:

    <xsl: sort select="preferredname" data-type="text" order="ascending" case-order="upper-first"/>

     

    Search for:

     

    <!-- This template is called for each result -->
    <xsl:template match="All_Results/Results">

     

    and replace it with this:

    <xsl:template match="All_Results">
    <xsl:for-each select="Result">
    <xsl: sort select="preferredname" data-type="text" order="ascending" case-order="upper-first"/>

    Then look for these lines below that:

     

    </xsl:template>

    <xsl:template name="HitHighlighting">
    ....

     

    The </xsl:template> is the end-tag of the template which is called for every result-row.

    Just directly in the line before enter:

     

    </xsl:for-each>         

    so that it looks like this then:

     

    </xsl:for-each>         
    </xsl:template>

    <xsl:template name="HitHighlighting">
    ....

     

    When you save the XSL to the webpart, then it now should sort your people by their preferredname.

    For a deeper understanding of XSLT and xsl: sort look here:

    http://www.learn-xslt-tutorial.com/Flow-Control.php

     

    Hope it helps

    Dietmar

     

    P.S.: In the upper code-snippets there is always a blank between xsl: and sort! This is not allowed. If I leave that out here in the post, it makes emoticons at that positions!

    Tuesday, May 13, 2008 3:44 PM