Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Maximum ASP
  Ads  
Biz Modules provides professional business modules and solutions for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  User Defined Ta...  xsl:if
Previous Previous
 
Next Next
New Post 3/24/2008 3:02 PM
User is offline Mike Riley
245 posts
9th Ranked


xsl:if 

I'm working on a custom XSLT and have hit a snag.  I have a Title column but want to completely hide the title (and line break) when a record has no Title.

 Here's a code snippet:

  <xsl:template match="udt:Data" mode="list">
    <div class="normal">
      <xsl:call-template name="EditLink" />
      <b>
        <xsl:value-of select="udt:Name" disable-output-escaping="yes" />
      </b>
      <br />
      <xsl:if test="@udt:Title">
        <xsl:value-of select="udt:Title" disable-output-escaping="yes" />
        <br />
      </xsl:if>
    </div>
    <br />
  </xsl:template>

The problem I'm having is that it'd completely hiding the Title, whether or not there's a value for Title.  I'm guessing it's probably going to be something real simple.

 
New Post 3/25/2008 12:38 PM
User is offline Brandon Haynes
693 posts
everysport.net
7th Ranked


Re: xsl:if 

Hi Mike,

I have zero experience working with the source UDT XML, but you do have one suspicious issue with your transform: you are looking for the title as an attribute and not an element (you reference Data and Name as an element).  Is it possible that you have an erroneous @ on your xsl:if clause, and it should instead read ... xsl:if test="udt:Title"...?

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post 3/27/2008 1:57 PM
User is offline Mike Riley
245 posts
9th Ranked


Re: xsl:if 

I finally got it working.  I had to use test="udt:Field!='  ' "  (spacing added between quotes to clarify this on the forums...no spacing between the single quotes).

 

  <xsl:template match="udt:Data" mode="list">
    <div class="normal">
      <xsl:call-template name="EditLink" />
      <b>
        <xsl:value-of select="udt:Name" disable-output-escaping="yes" />
      </b>
      <br />
      <xsl:if test="udt:Title!=''">
        <xsl:value-of select="udt:Title" disable-output-escaping="yes" />
        <br />
      </xsl:if>

      <xsl:if test="udt:Fax!=''">
        Fax: <xsl:value-of select="udt:Fax" disable-output-escaping="yes" />
        <br />
      </xsl:if>
    </div>
    <br />
  </xsl:template>

 
New Post 3/27/2008 4:57 PM
User is offline Brandon Haynes
693 posts
everysport.net
7th Ranked


Re: xsl:if 

Yeah, that was going to be my second suggestion.  Existance of an element (test="element") is different than testing if an element is equal to the empty string (test="element = ''").  Glad you got it working!


Brandon Haynes
BrandonHaynes.org
 
New Post 3/28/2008 1:00 PM
User is offline Mike Riley
245 posts
9th Ranked


Re: Re: xsl:if 

I was just the syntax for "not equals" that was causing the problem.  I'm surprised that syntax isn't listed on more sites/examples of xsl:if.

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  User Defined Ta...  xsl:if
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


R2i - Delivering Serious DNN Services & Solutions
Award Winning Design, Skin construction, Custom Modules and Consulting Services for the Enterprise organization. R2i is the DNN:Map module Project Lead and one of the largest DNN service providers with offices in New York City, Virginia and Baltimore.
www.bi4ce.com
"SalarO" Skinning Graphic Design Branding Services
SalarO develops packaged & custom skins for your DNN at prices you can afford. SalarO is also developing Module development, Hosting, Branding/Logo design as well as Content Transfer Services to complement the core skinning solutions.
www.salaro.com
Data Springs Inc. - Module Development
Data Springs is a leader in the DNN community offering high quality modules, custom module development, enhancements to the DNN core product and overall DNN support.
www.datasprings.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP