95 lines
3.5 KiB
XML
95 lines
3.5 KiB
XML
<?xml version="1.0"?>
|
|
<root>
|
|
<LabelType>问答类</LabelType>
|
|
<LabelIntro>一级类别列表</LabelIntro>
|
|
<OutType>sin</OutType>
|
|
<LabelDataType>sql_sysquery</LabelDataType>
|
|
<EnabelAjax>False</EnabelAjax>
|
|
<attributes>
|
|
<name>TopNum</name>
|
|
<datatype>sql.int</datatype>
|
|
<default>0</default>
|
|
<intro>显示项数</intro>
|
|
</attributes>
|
|
<IsXsltSql>true</IsXsltSql>
|
|
<IsXsltCountSql>false</IsXsltCountSql>
|
|
<LabelSqlString>
|
|
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
|
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe">
|
|
<xsl:param name="TopNum" />
|
|
<xsl:param name="ParentId" />
|
|
<xsl:output method="xml" />
|
|
<xsl:template match="/">
|
|
<root>
|
|
<sql>
|
|
SELECT TOP @TopNum PE_QA_Category.CategoryName,PE_QA_Category.CategoryID
|
|
FROM PE_QA_Question right join PE_QA_Category on PE_QA_Category.CategoryID = PE_QA_Question.CategoryID WHERE
|
|
<xsl:choose>
|
|
<xsl:when test="$ParentId>0">
|
|
PE_QA_Category.ParentID=@ParentId AND PE_QA_Category.ParentID <> PE_QA_Category.CategoryID
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
PE_QA_Category.ParentID=PE_QA_Category.CategoryID
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
GROUP BY PE_QA_Category.CategoryID,PE_QA_Category.CategoryName
|
|
</sql>
|
|
<countsql>
|
|
</countsql>
|
|
</root>
|
|
</xsl:template>
|
|
</xsl:transform>]]></LabelSqlString>
|
|
<LabelTemplate>
|
|
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
|
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe">
|
|
<xsl:param name="ShowType" />
|
|
<xsl:param name="Keyword" />
|
|
<xsl:output method="html" />
|
|
<xsl:template match="/">
|
|
<xsl:if test="count(/NewDataSet/Table) != 0">
|
|
<div class="classified">
|
|
<ul>
|
|
<xsl:for-each select="/NewDataSet/Table">
|
|
<li>
|
|
<a>
|
|
<xsl:attribute name="href">
|
|
<xsl:choose>
|
|
<xsl:when test="$ShowType > 0 and $ShowType <= 5">
|
|
{PE.SiteConfig.ApplicationPath/}QA/QuestionList.aspx?Id=<xsl:value-of select="CategoryID"/>&ShowType=<xsl:value-of select="$ShowType"/>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
{PE.SiteConfig.ApplicationPath/}QA/QuestionList.aspx?Id=<xsl:value-of select="CategoryID"/>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
<xsl:if test="$Keyword!=''">&Keyword=<xsl:value-of select="pe:UrlEncode($Keyword)"/></xsl:if>
|
|
</xsl:attribute>
|
|
<xsl:value-of select="CategoryName"/>({PE.Label id="显示类型下问题数" CategoryID="<xsl:value-of select="CategoryID"/>" Keyword="<xsl:value-of select="$Keyword"/>" ShowType="<xsl:value-of select="$ShowType"/>"/})
|
|
</a>
|
|
</li>
|
|
</xsl:for-each>
|
|
<br class="clearbox" />
|
|
</ul>
|
|
</div>
|
|
</xsl:if>
|
|
</xsl:template>
|
|
</xsl:transform>]]></LabelTemplate>
|
|
<attributes>
|
|
<name>ParentId</name>
|
|
<datatype>supersql</datatype>
|
|
<default>0</default>
|
|
<intro>一级分类ID</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>ShowType</name>
|
|
<datatype>int</datatype>
|
|
<default>0</default>
|
|
<intro>显示类型</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>Keyword</name>
|
|
<datatype>supersql</datatype>
|
|
<default>
|
|
</default>
|
|
<intro>关键字</intro>
|
|
</attributes>
|
|
</root> |