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 ListGrouping by multiple options - XSLGrouping by multiple options - XSL
Previous
 
Next
New Post
12/6/2011 11:17 AM
 

Hello..
I have a forms and list for departmental meeting minutes.  I was wondering if it's possible to group by multiple items.  I've tried but have been unable to get this working properly.

For example, I have four different departments, so I need the minutes grouped by departments; this isn't a problem. I can also create an XSL sheet which groups the items by month and year.

But, I need to group these meeting minutes first by departments and then by the month and year the meetings occurred. E.g.:

 Board of Trustees
   January 2011
      January 1st, 2011
      January 5th, 2011
   February 2011
      February 3rd, 2011
      February 7th, 2011

Zoning Commission
   January 2011
      January 3rd, 2011
      January 7th, 2011
   February 2011
      February 9th, 2011
      February 1th, 2011

Any help would be appreciated. Thanks.. -Jeff

What I have thus far (this doesn't work):
<?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:key name="data-by-department" match="udt:Data" use="udt:Department" />
  <xsl:key name="data-by-date" match="udt:Data" use="udt:Month_x0020_and_x0020_Year" />


  <xsl:template match="udt:Data" mode="list">
    <li>
      <xsl:call-template name="EditLink" />
 <xsl:value-of select="udt:Minutes" disable-output-escaping="yes" />
</li>
  </xsl:template>


  <xsl:template match="/udt:UserDefinedTable">
    <ul style="padding-top: 15px;">
      <xsl:for-each select="udt:Data[count(. | key('data-by-department', udt:Department)[1]) = 1]">
        <li>
          <xsl:value-of select="udt:Department" disable-output-escaping="yes" />&160;MINUTES
            <ul>
              <li>
                <xsl:for-each select="udt:Data[count(. | key('data-by-date', udt:Month_x0020_and_x0020_Year)[1]) = 1]">
                <xsl:variable name="currentData" select="key('data-by-date', udt:Month_x0020_and_x0020_Year)" />
                  <xsl:apply-templates select="$currentData" mode="list">
                  </xsl:apply-templates>
                </xsl:for-each>
              </li>
            </ul>
        </li>
      </xsl:for-each>
    </ul>
  </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
12/6/2011 4:43 PM
 

Ok.. I think I have something working which works for me; sort-of.  I'll post my further question tomorrow; need to get outta work.  But here's what I have to get it working somewhat like I want.  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:key name="data-by-department" match="udt:Data" use="udt:Department" />
  <xsl:key name="data-by-date" match="udt:Data" use="udt:Month_x0020_and_x0020_Year" />


  <xsl:template match="udt:Data" mode="list">
    <li>
 <xsl:value-of select="udt:Minutes" disable-output-escaping="yes" />&#160;<xsl:call-template name="EditLink" />
</li>
  </xsl:template>


  <xsl:template match="/udt:UserDefinedTable">
    <xsl:for-each select="udt:Data[count(. | key('data-by-department', udt:Department)[1]) = 1]">
      <xsl:variable name="DepartmentData" select="key('data-by-department', udt:Department)" />
        <p style="line-height: 22px; font-size: 18px; font-weight: bold; text-align: justify;text-transform:uppercase;padding: 0">
          <xsl:value-of select="udt:Department" disable-output-escaping="yes" />&#160;MINUTES
        </p>
        <xsl:choose>
          <xsl:when test="$DepartmentData">
            <ul>
              <xsl:for-each select="$DepartmentData[count(. | key('data-by-date', udt:Month_x0020_and_x0020_Year)[1]) = 1]">
              <xsl:sort select="udt:Date_x0020_of_x0020_Meeting" order="ascending" />
              <li>
                <xsl:variable name="currentData" select="key('data-by-date', udt:Month_x0020_and_x0020_Year)" />
                <xsl:if test="$currentData">
                  <xsl:value-of select="udt:Month_x0020_and_x0020_Year" disable-output-escaping="yes" />
                  <ul>
                    <xsl:apply-templates select="$currentData" mode="list">
                    </xsl:apply-templates>
                  </ul>
                </xsl:if>
              </li>
              </xsl:for-each>
            </ul>
          </xsl:when>
          <xsl:otherwise>
            <table align="center" width="90%">
              <tr>
                <td>
                  <br/><br/><strong>There are no meeting miuntes at this time.</strong><br/>
                  Please check back soon.
                </td>
              </tr>
            </table>
          </xsl:otherwise>
        </xsl:choose>
</xsl:for-each>
  </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>
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListGrouping by multiple options - XSLGrouping by multiple options - XSL


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