Solved

Hide field when it has no value

Posted on 2007-12-07
2
719 Views
Last Modified: 2013-11-18
Experts,

On our sharepoint intranet site we changed the XSL of the people searh results like this:

        <font color="#FF6633">Title: </font>
        <xsl:if test='string-length($title) &gt; 0'>
         <xsl:value-of select="$title" /><br />
        </xsl:if>

        <font color="#FF6633">Department: </font>
        <xsl:if test='string-length($dep) &gt; 0'>
         <xsl:value-of select="$dep" /> <br />
        </xsl:if>

        <font color="#FF6633">Office Nr.: </font>
        <xsl:if test='string-length($phone) &gt; 0'>
         <xsl:value-of select="$phone" /><br />
        </xsl:if>

But when a user eg. does not have an office nr, the word "Office Nr.:" is still visible, how can I hide it when it has no value

thx in advance
0
Comment
Question by:ITBenelux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
R7AF earned 300 total points
ID: 20426876
How about including the text in the xsl-if?
<xsl:if test='string-length($phone) &gt; 0'>
         <font color="#FF6633">Office Nr.: </font>
         <xsl:value-of select="$phone" /><br />
</xsl:if>

Open in new window

0
 
LVL 1

Author Comment

by:ITBenelux
ID: 20426903
Simple :-) you just need to know it.... thank for the quick answer. !
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logiā€¦
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question