I'm having a hard time with detail view urls when grouping data. I get extra spaces in the url, for example /Research-Findings/Current-Completed-Projects?%20%20%20%20%20%20%20%20udt_1588_param%20%20%20%20_detail=1857.
I cannot figure out what I'm doing wrong in the stylesheet as <a href="?{$prefix_param}_detail={udt:UserDefinedRowId}"> works otherwise. The grouping seems to be the issue.
Here is the full stylesheet:
<?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:param name="param_detail" />
<xsl:key name="data-by-topic" match="udt:Data" use="udt:Topic" />
<xsl:template match="udt:Data" mode="detail">
<xsl:call-template name="EditLink" />
<xsl:call-template name="ListView" />
Category: <xsl:value-of select="udt:Topic" disable-output-escaping="yes" />
Status: <xsl:value-of select="udt:Status" disable-output-escaping="yes" /><xsl:value-of select="udt:Title" disable-output-escaping="yes" /><xsl:value-of select="udt:Funding_x0020_Source" disable-output-escaping="yes" /><xsl:value-of select="udt:Funding_x0020_Period" disable-output-escaping="yes" /><xsl:value-of select="udt:Study_x0020_Design" disable-output-escaping="yes" /><xsl:value-of select="udt:Purpose" disable-output-escaping="yes" /><xsl:value-of select="udt:Further_x0020_Study_x0020_Details" disable-output-escaping="yes" /><xsl:value-of select="udt:Findings" disable-output-escaping="yes" /><xsl:value-of select="udt:Eligibility" disable-output-escaping="yes" /><xsl:value-of select="udt:Participation_x0020_Information" disable-output-escaping="yes" /><xsl:value-of select="udt:Description" disable-output-escaping="yes" /><xsl:value-of select="udt:Qualifications" disable-output-escaping="yes" /><xsl:value-of select="udt:Benefits" disable-output-escaping="yes" /><xsl:value-of select="udt:Application" disable-output-escaping="yes" />
</xsl:template>
<xsl:template match="udt:Data" mode="list">
<li class="dnnGridItem">
<xsl:call-template name="DetailView" />
-
<xsl:value-of select="udt:Status" disable-output-escaping="yes" />
</li>
</xsl:template>
<xsl:template match="/udt:UserDefinedTable">
<xsl:for-each select="udt:Data[count(. | key('data-by-topic', udt:Topic)[1]) = 1]">
<xsl:sort select="udt:Topic" order="ascending" />
<h3>
<xsl:value-of select="udt:Topic" disable-output-escaping="yes" />
</h3>
<xsl:choose>
<xsl:when test="$param_detail">
<!--master-detail view-->
<xsl:apply-templates select="udt:Data[udt:UserDefinedRowId=$param_detail]" mode="detail" />
</xsl:when>
<xsl:otherwise>
<xsl:variable name="currentData" select="key('data-by-topic', udt:Topic)" />
<xsl:if test="$currentData">
<ul>
<xsl:apply-templates select="$currentData" mode="list">
</xsl:apply-templates>
</ul>
</xsl:if>
</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:template name="ListView">
<a href="{//udt:Context/udt:ApplicationPath}/tabid/{//udt:Context/udt:TabId}/Default.aspx">
<img border="0" alt="Back" src="{//udt:Context/udt:ApplicationPath}/images/lt.gif" />
</a>
</xsl:template>
<xsl:template name="DetailView">
<a href="?{$prefix_param}_detail={udt:UserDefinedRowId}">
<xsl:value-of select="udt:Title" disable-output-escaping="yes" />
</a>
</xsl:template>
</xsl:stylesheet>