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 Listtwo column BasicTabletwo column BasicTable
Previous
 
Next
New Post
2/18/2007 6:00 PM
 

It is just as easy as discribed inside the link on your website. All you need to do is following its instruction:

<?xml version="1.0" encoding="UTF-8" ?>
<!--
 DotNetNuke® - http://www.dotnetnuke.com
 Copyright (c) 2002-2006 by DotNetNuke Corp.
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
 documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
 the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 
 to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 The above copyright notice and this permission notice shall be included in all copies or substantial portions 
 of the Software.
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
 TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 DEALINGS IN THE SOFTWARE.
-->
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:udt="DotNetNuke/UserDefinedTable">
<xsl:output method="xml" version="1.0"  indent="yes" omit-xml-declaration="yes"/>
    <xsl:template match="/udt:UserDefinedTable">
    
   
        <table cellspacing="0" cellpadding="4" border="0"  style="border-width:0px;border-collapse:collapse;">
            <tr class="NormalBold UDT_Table_Head">
                <th/>
                <xsl:for-each select="udt:Fields">
                    <xsl:if test="udt:Visible='true' or udt:Visible='True'">
                        <th>
                            <xsl:value-of select ="udt:FieldTitle"/>
                        </th>                
                    </xsl:if>
                </xsl:for-each> 
                <xsl:for-each select="udt:Fields">
                    <xsl:if test="udt:Visible='true' or udt:Visible='True'">
                        <th>
                            <xsl:value-of select ="udt:FieldTitle"/>
                        </th>                
                    </xsl:if>
                </xsl:for-each> 
            </tr>
            <xsl:for-each select="udt:Data[position()mod 2=1]">
            
                
                <xsl:variable name="id" select="udt:UserDefinedRowId"/>
            
                <tr >
                    <xsl:attribute name="class">
                    <xsl:choose>
                        <xsl:when test="position() mod 2 = 1">
                            Normal UDT_Table_AlternateItem
                        </xsl:when>
                        <xsl:otherwise>
                            Normal UDT_Table_Item
                        </xsl:otherwise>
                    </xsl:choose>
                    </xsl:attribute>  
                    <td>
                        <xsl:if test="udt:EditLink">
                            <a>
                                <xsl:attribute name="href">
                                    <xsl:value-of select="udt:EditLink" />
                                </xsl:attribute>
                                <img border="0" alt="edit">
                                    <xsl:attribute name="src">
                                        <xsl:value-of select="//udt:Context/udt:ApplicationPath"/>/images/edit.gif
                                    </xsl:attribute>
                                </img>
                            </a>
                        </xsl:if>
                    </td>
                    <xsl:for-each select="//udt:Fields">    
                        <xsl:if test="udt:Visible='true' or udt:Visible='True'">        
                            <td>
                                <xsl:variable name="NameOfValueColumn" select="udt:ValueColumn"/>
                                <xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$id]/*[name()=$NameOfValueColumn]" disable-output-escaping="yes"/>        
                            </td>
                        </xsl:if> 
                    </xsl:for-each>
                    
                    <xsl:choose>
                        <xsl:when test="count(following-sibling::*[name()=name(current())])">
                    
                            <td>
                                <xsl:if test="following-sibling::*/udt:EditLink">
                                    <a>
                                        <xsl:attribute name="href">
                                            <xsl:value-of select="following-sibling::*/udt:EditLink" />
                                        </xsl:attribute>
                                        <img border="0" alt="edit">
                                            <xsl:attribute name="src">
                                                <xsl:value-of select="//udt:Context/udt:ApplicationPath"/>/images/edit.gif
                                            </xsl:attribute>
                                        </img>
                                    </a>
                                </xsl:if>
                            </td>
                            <xsl:variable name="id2" select="following-sibling::*/udt:UserDefinedRowId"/>
                            <xsl:for-each select="//udt:Fields">    
                                <xsl:if test="udt:Visible='true' or udt:Visible='True'">        
                                    <td>
                                        <xsl:variable name="NameOfValueColumn" select="udt:ValueColumn"/>
                                        <xsl:value-of select="//udt:Data[udt:UserDefinedRowId=$id2]/*[name()=$NameOfValueColumn]" disable-output-escaping="yes"/>        
                                    </td>
                                </xsl:if> 
                            </xsl:for-each>
                    
                        </xsl:when>
                        <xsl:otherwise>
                            <td/>
                            <xsl:for-each select="//udt:Fields">    
                                    <xsl:if test="udt:Visible='true' or udt:Visible='True'">        
                                        <td/>
                                    </xsl:if> 
                            </xsl:for-each>                
                        </xsl:otherwise>
                    </xsl:choose>
                    
                </tr>
            </xsl:for-each> 
        </table>
    </xsl:template>
 
</xsl:stylesheet>
 
 
 
New Post
2/19/2007 8:12 AM
 

Perfect. thanks (usually means I want more of the same).  one more embelishment? adding a third column?  hints? I tried changing mod 2 to mod 3 added another grouping on the row like this:

                           <td>
... <xsl:if test="following-sibling::*/udt:EditLink">
</xsl:choose>
all I did was change id2 to id3...but I just got a copy of id2.
my guess is I have to do more to these statements (or perhaps I need a mod 3=1, mod 3=2:
                        <xsl:when test="count(following-sibling::*[name()=name(current())])">
                         <xsl:variable name="id2" select="following-sibling::*/udt:UserDefinedRowId"/>

										
 
New Post
2/19/2007 11:04 AM
 
Well, if you want more feel free to contact and hire me, I will offer you a special discount
 
New Post
2/19/2007 3:31 PM
 

Well, Tom mailed me and I decided to help again, as the original example isn't easy to catch and even worse to extend.

Please be aware that I am not going to extend this to a 4 col. solution.

<?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">
<xsl:output method="xml" version="1.0"  indent="yes" omit-xml-declaration="yes"/>
    <xsl:template match="/udt:UserDefinedTable">
        <table cellspacing="0" cellpadding="4" border="0"  style="border-width:0px;border-collapse:collapse;">
            <tr class="NormalBold UDT_Table_Head">
        <!-- header 1-->
                <th/>
                <xsl:for-each select="udt:Fields">
                    <xsl:if test="udt:Visible='true' or udt:Visible='True'">
                        <th>
                            <xsl:value-of select ="udt:FieldTitle"/>
                        </th>                
                    </xsl:if>
                </xsl:for-each>
        <!-- header 2-->
        <th/>
                <xsl:for-each select="udt:Fields">
                    <xsl:if test="udt:Visible='true' or udt:Visible='True'">
                        <th>
                            <xsl:value-of select ="udt:FieldTitle"/>
                        </th>                
                    </xsl:if>
                </xsl:for-each>
        <!-- header 3-->
        <th/>
        <xsl:for-each select="udt:Fields">
          <xsl:if test="udt:Visible='true' or udt:Visible='True'">
            <th>
              <xsl:value-of select ="udt:FieldTitle"/>
            </th>
          </xsl:if>
        </xsl:for-each>
      </tr>
      <!--position() ->position inside udt:Data -->
            <xsl:for-each select="udt:Data[position()mod 3=1]">
        <tr >
          <xsl:attribute name="class">
            <xsl:choose>
              <!--position() ->position regardind alway the third udt:Data element -->
              <xsl:when test="position() mod 2 = 1">Normal UDT_Table_AlternateItem</xsl:when>
              <xsl:otherwise>Normal UDT_Table_Item</xsl:otherwise>
            </xsl:choose>
          </xsl:attribute>
          <xsl:call-template name ="ShowOneUDTRow">
            <xsl:with-param name ="Index" select ="(position()-1)*3 +1"/>
          </xsl:call-template>
          <xsl:call-template name ="ShowOneUDTRow">
            <xsl:with-param name ="Index" select ="(position()-1)*3 +2"/>
          </xsl:call-template>
          <xsl:call-template name ="ShowOneUDTRow">
            <xsl:with-param name ="Index" select ="(position()-1)*3 +3"/>
          </xsl:call-template>
        </tr>
      </xsl:for-each>
    </table>
  </xsl:template>
 
  <xsl:template name ="ShowOneUDTRow">
    <xsl:param name ="Index"/>
        <td>
          <xsl:if test="//udt:Data[$Index]/udt:EditLink">
            <a>
              <xsl:attribute name="href">
                <xsl:value-of select="//udt:Data[$Index]/udt:EditLink" />
              </xsl:attribute>
              <img border="0" alt="edit">
                <xsl:attribute name="src">
                  <xsl:value-of select="//udt:Context/udt:ApplicationPath"/>/images/edit.gif
                </xsl:attribute>
              </img>
            </a>
          </xsl:if>
        </td>
        <xsl:for-each select="//udt:Fields">
          <xsl:if test="udt:Visible='true' or udt:Visible='True'">
            <td>
              <xsl:variable name="NameOfValueColumn" select="udt:ValueColumn"/>
              <xsl:value-of select="//udt:Data[$Index]/*[name()=$NameOfValueColumn]" disable-output-escaping="yes"/>
            </td>
          </xsl:if>
        </xsl:for-each>
  </xsl:template>
</xsl:stylesheet>
 
New Post
2/19/2007 9:04 PM
 
thanks, Stefan. that was above and beyond the call of duty.  I tried on my own to figure out how position could work for about an hour and white-flagged it.  I'll prnt out that XPATH stuff and learn from that.  I owe you plenty o'documentation and a pint or two. cheers.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and Listtwo column BasicTabletwo column BasicTable


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