Solved

Hide field when it has no value

Posted on 2007-12-07
2
713 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
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now