Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListXSL blank value if/choose statement, Need assistanceXSL blank value if/choose statement, Need assistance
Previous
 
Next
New Post
5/17/2010 1:44 PM
 

            
I have a field called "Audio File" it is a Download Type.   I use xslt script to reformat the list, but i need to add an if/then or choose/when/otherwise. 
psudo code---
if the "Audio File"  URL is blank (nothing downloaded).. then dont show the link and its text
else show audio file linktext
End psudo code---
 
Here is what i tried.  But i get a manditory test error

_________________Solved_______________---
Ok i am guilty of... "I don't want to learn, i just want someone to tell me the answer"
It didnt take that much to learn the answer.  Here it is, if someone is searching for this.

<xsl:variable name="AudioURLExists" select="udt:Audio_UDT_Url" />
          <xsl:choose>
            <xsl:when test="$AudioURLExists=''">
            </xsl:when>
            <xsl:otherwise>
              <a href="{udt:Audio_UDT_Url}">
                <img src="http://mydomain.org/portals/1326/icon..." border="0" />
              </a>
            </xsl:otherwise>
          </xsl:choose>


        
        

        
          

              
                (Audio)
             

           
         
       
     


I am sure there is just a little something i am missing. 

Brandon
 
New Post
5/18/2010 1:51 PM
 
Brandon, Does your updated code work? Your post is a bit confusing as to whether or not you solved it. I've used xsl:if and use field!="" as my test.
 
New Post
5/18/2010 2:23 PM
 
Yes sorry didnt use the code snippet system for pasting that.. made a mess of the post.  Below is the solution for adding in a qualifier to your UDT.  This checks my download field called "Audio"  If the user uploaded an audio file or linked one.  Then it displays my Audio icon and makes it a hot link.

<
xsl:variable name="AudioURLExists" select="udt:Audio_UDT_Url" />
          <xsl:choose>
            <xsl:when test="$AudioURLExists=''">
            </xsl:when>
            <xsl:otherwise>
              <a href="{udt:Audio_UDT_Url}">
                <img src="http://mydomain.org/portals/1326/icon..." border="0" />
              </a>
            </xsl:otherwise>
          </xsl:choose>
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListXSL blank value if/choose statement, Need assistanceXSL blank value if/choose statement, Need assistance


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out