Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • devSteven 6 posts 26 karma points
    Feb 01, 2010 @ 06:25
    devSteven
    0

    how to change search xslt when content is empty

    hi all,

    please help me,  I have a question about search xslt 

    if node's have title name but content is empty ,I want to no display  is search result

    how can I change search xslt ,

    thanks

    regards

    devsteven

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Feb 01, 2010 @ 08:54
    Dirk De Grave
    1

    I guess you'll just need to add an extra <xsl:if> statement that checks whether the property's value is not empty

    <xsl:if test="string(./data [@alias = 'propertyAlias'] != ''">
    <xsl:value-of select="./data [@alias = 'propertyAlias']" />
    </xsl:if>

     

    Hope this helps.

    Regards,

    /Dirk

  • devSteven 6 posts 26 karma points
    Feb 02, 2010 @ 06:24
    devSteven
    0

    Hi Dirk,

    but I don't know how can I add this code in search xslt, could you Say it specific,

    thank you very much

    Regards,

    devsteven

     

  • devSteven 6 posts 26 karma points
    Feb 02, 2010 @ 06:51
    devSteven
    0
    <xsl:variable name="search">
      <xsl:choose>
       <!-- querystring value, if present -->
       <xsl:when test="string(umbraco.library:RequestQueryString('search')) != ''">
        <xsl:value-of select="ps:escapeSearchTerms(string(umbraco.library:RequestQueryString('search')))" />
       </xsl:when>
                                <!-- form field value, if present -->
       <xsl:when test="string(umbraco.library:RequestForm('search')) != ''">
        <xsl:value-of select="ps:escapeSearchTerms(string(umbraco.library:RequestForm('search')))" />
       </xsl:when>
                               <xsl:when test="string(./data [@alias = 'propertyAlias']) != ''">
                                           <xsl:value-of select="./data [@alias = 'propertyAlias']" />
                                </xsl:when>

       <!-- no value -->
       <xsl:otherwise>
        <xsl:value-of select="''"/>
       </xsl:otherwise>
      </xsl:choose>
     </xsl:variable>

       I try it ,but still display when node's content is empty,  please help me,

      thang you ,

     devsteven

  • Chau 66 posts 97 karma points
    Feb 02, 2010 @ 08:00
    Chau
    0

    is it empty or is it null?

  • devSteven 6 posts 26 karma points
    Feb 02, 2010 @ 08:55
    devSteven
    0

    it is have node titie  ,but content is null,

     

  • devSteven 6 posts 26 karma points
    Feb 02, 2010 @ 08:59
    devSteven
    0

    I don't know how to filter this condition ,could you help me

    regards,

    devsteven

  • devSteven 6 posts 26 karma points
    Feb 03, 2010 @ 06:31
    devSteven
    0

    no body can help me ?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies