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 Conditional Statement - Different ConfigXSL Conditional Statement - Different Config
Previous
 
Next
New Post
8/19/2011 1:57 PM
 
Hello..
I'm trying something different than the conditional statement shown here; http://www.dotnetnuke.com/Resources/F...

But just a quick overview.  I have a column named Icon and it's configured as a Image column.  I have paired values configured for a list of values so for example the end-user selects PDF, and it'll link to proper icon location of the paired value and when the list is viewed, the proper Icon is shown on the list.

For the layout, I'm using a table with one cell in a row.  For items which are PDFs, I'd like left-side padding for the pdf file information and for items which are the ZIP files, I'd like them listed without the left-side padding.  What this does is displays the month zip files at the top of the listing all the way to the left with the monthly pdf meeting mintues below it indented; a tree type look/feel.

I've tried a number of different things, but it's not working properly.  Can some assist?  Thanks.. -Jeff

If I try a <xsl:if test="udt:Icon!='ZIP' or udt:Icon!='NoZip'"> statement, it displays the all the items twice; one without the left side padding and another listing of the same item with the padding.

If I try a <xsl:choose><xsl:when test="udt:Icon!='ZIP' or udt:Icon!='NoZip'"> then all the items are listed once but there isn't any left-side padding for the PDF files.

I've tried changing the what to look for to the actualy URL's of the images, but this too didn't work properly.  Below is the code for both configurations.

XSL:IF Statements:
<xsl:if test="udt:Icon!='Zip' or udt:Icon!='NoZip'">
    <tr class="Normal">
      <td>
        <xsl:value-of select="udt:Board_x0020_of_x0020_Trustees" disable-output-escaping="yes" />&#160;<xsl:call-template name="EditLink" /></td>
    </tr>
  </xsl:if>
  <xsl:if test="udt:Icon!='PDF' or udt:Icon!='NoPDF' or udt:Icon!='Agenda'">
    <tr class="Normal">
      <td>
        <div style="padding-left: 20px;">
 <xsl:value-of select="udt:Board_x0020_of_x0020_Trustees" disable-output-escaping="yes" />&#160;<xsl:call-template name="EditLink" />
</div>
      </td>
    </tr>
  </xsl:if>

XSL:CHOOSE Statements:
<xsl:choose>
    <xsl:when test="udt:Icon!='Zip' or udt:Icon!='NoZip'">
      <tr class="Normal">
        <td>
          <xsl:value-of select="udt:Board_x0020_of_x0020_Trustees" disable-output-escaping="yes" />&#160;<xsl:call-template name="EditLink" /></td>
      </tr>
    </xsl:when>
<xsl:when test="udt:Icon!='PDF' or udt:Icon!='NoPDF' or udt:Icon!='Agenda'">
      <tr class="Normal">
        <td>
          <div style="padding-left: 20px;">
            <xsl:value-of select="udt:Board_x0020_of_x0020_Trustees" disable-output-escaping="yes" />&#160;<xsl:call-template name="EditLink" />
          </div>
        </td>
      </tr>
    </xsl:when>
  </xsl:choose>
 
New Post
8/19/2011 3:48 PM
 
Tried something different.

I converted the Icon Image column into a text column and kept the values for PDF, Zip, NoZip, etc.  I removed the paired values.  Then within the XSLT file, I point the icon cell to the proper location of the icon file for each instance.

Within the XSLT doc, I tried both XSL:IF and XSL:CHOOSE/XSL:WHEN configurations.
With the XSL:IF statement, it puts each icon on a new row of every item; 5 rows of the same item with separate icons.  For the PDF file types, it is putting the proper spacing in front of the file.  This is what I want.
With the XSL:CHOOSE/XSL:WHEN configuration, the first item in the list is showing the NoZip file icon (which is wrong), but every item after is showing the Zip file icon; which is wrong as well.

Any ideas?  Thanks.. -Jeff

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:udt="DotNetNuke/UserDefinedTable" exclude-result-prefixes="udt">
  <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
  <!--
  This prefix is used to generate module specific query strings
  Each querystring or form value that starts with udt_{ModuleId}_param 
  will be added as parameter starting with param
  -->
  <xsl:variable name="prefix_param">udt_<xsl:value-of select="//udt:Context/udt:ModuleId" />_param</xsl:variable>
    
  <xsl:template match="udt:Data" mode="list">
  <xsl:choose>
    <xsl:when test="udt:Icon!='ZIP'">
      <tr class="Normal">
        <td>
 <img src="/Portals/7/resources/images/homepage/zip_folder_icon.png" alt="Zipped Folder" />
</td>
<td colspan="2">
 <xsl:value-of select="udt:Minutes_x0020_Information" disable-output-escaping="yes" />&#160;<xsl:call-template name="EditLink" />
</td>
      </tr>
    </xsl:when>
<xsl:when test="udt:Icon!='NoZip'">
      <tr class="Normal">
        <td>
 <img src="/Portals/7/resources/images/homepage/nozip_folder_icon.png" alt="No-Zipped Folder" />
</td>
<td colspan="2">
          <xsl:value-of select="udt:Minutes_x0020_Information" disable-output-escaping="yes" />&#160;<xsl:call-template name="EditLink" />
</td>
      </tr>
    </xsl:when>
<xsl:when test="udt:Icon!='PDF'">
      <tr class="Normal">
   <td>&#160;</td>
<td>
 <img src="/Portals/7/resources/images/homepage/gen_pdf_file_icon.png" alt="PDF File" />
</td>
        <td>
 <xsl:value-of select="udt:Minutes_x0020_Information" disable-output-escaping="yes" />&#160;<xsl:call-template name="EditLink" />
        </td>
      </tr>
    </xsl:when>
<xsl:when test="udt:Icon!='NoPDF'">
      <tr class="Normal">
   <td>&#160;</td>
<td>
 <img src="/Portals/7/resources/images/homepage/gen_pdf_nofile_icon.png" alt="No-PDF File" />
</td>
        <td>
 <xsl:value-of select="udt:Minutes_x0020_Information" disable-output-escaping="yes" />&#160;<xsl:call-template name="EditLink" />
        </td>
      </tr>
    </xsl:when>
<xsl:when test="udt:Icon!='Agenda'">
      <tr class="Normal">
   <td>&#160;</td>
<td>
 <img src="/Portals/7/resources/images/homepage/agenda_icon.png" alt="Agenda PDF File" />
</td>
        <td>
 <xsl:value-of select="udt:Minutes_x0020_Information" disable-output-escaping="yes" />&#160;<xsl:call-template name="EditLink" />
        </td>
      </tr>
    </xsl:when>
  </xsl:choose>
  </xsl:template>


  <xsl:template match="/udt:UserDefinedTable">
    <xsl:variable name="currentData" select="udt:Data" />
    <xsl:if test="$currentData">
      <table cell-padding="2">
        <xsl:apply-templates select="$currentData" mode="list">
        </xsl:apply-templates>
      </table>
    </xsl:if>
  </xsl:template>


  <xsl:template name="EditLink">
    <xsl:if test="udt:EditLink">
      <a href="{udt:EditLink}">
        <img border="0" alt="edit" src="{//udt:Context/udt:ApplicationPath}/images/edit.gif" />
      </a>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>
 
New Post
8/23/2011 9:07 AM
 
Hello..
I've even tried the following for a filter of the F&L, [Icon]='PDF' as well as [Icon]='http://websiteurl.com/portal/0/resources/icon/pdf_icon.png' hoping that it'd only display the items which have the PDF paired value selected.

This too didn't work. Any ideas on why this isn't working properly?

Thanks.. -Jeff
 
New Post
8/23/2011 10:31 AM
 
Jeff, the correct statement depends on the datatype for your icon field, and it is much different if it is a text/string compared to an image.
The image datatype uses hidden columns. Please study your XML (Action Menu, show all data as xml). 
PS: Visual Studio Proffessional has great XSL support, and allows you to even debug your scripts against your data.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListXSL Conditional Statement - Different ConfigXSL Conditional Statement - Different Config


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