Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Hide field when it has no value

Posted on 2007-12-07
2
Medium Priority
?
721 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 1200 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
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.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

618 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