141 lines
4.4 KiB
XML
141 lines
4.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<root>
|
|
<LabelType>博客类</LabelType>
|
|
<LabelIntro>
|
|
</LabelIntro>
|
|
<OutType>sin</OutType>
|
|
<LabelDataType>sql_sysquery</LabelDataType>
|
|
<EnabelAjax>True</EnabelAjax>
|
|
<Version officialVersion="" modifiedVersions="2913" compatibleVersion="" />
|
|
<attributes>
|
|
<name>linkOpenType</name>
|
|
<datatype>string</datatype>
|
|
<default>
|
|
</default>
|
|
<intro>默认为原窗口打开,新窗口打开:_blank</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>listOrderType</name>
|
|
<datatype>int</datatype>
|
|
<default>1</default>
|
|
<intro>排序方式:1排序ID排序、2按类别ID排序(升序)、3按类别ID排序(降序)</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">
|
|
<xsl:param name="listOrderType" />
|
|
<xsl:output method="xml" />
|
|
<xsl:template match="/">
|
|
<root>
|
|
<sql>
|
|
SELECT TOP @outputQty * FROM PE_BG_Category
|
|
<xsl:choose>
|
|
<xsl:when test="$listOrderType=1"> ORDER BY OrderID ASC</xsl:when>
|
|
<xsl:when test="$listOrderType=2"> ORDER BY CategoryID ASC</xsl:when>
|
|
<xsl:when test="$listOrderType=3"> ORDER BY CategoryID DESC</xsl:when>
|
|
<xsl:otherwise> ORDER BY OrderID ASC</xsl:otherwise>
|
|
</xsl:choose>
|
|
</sql>
|
|
<sqlpage>
|
|
</sqlpage>
|
|
<countsql>
|
|
</countsql>
|
|
</root>
|
|
</xsl:template>
|
|
</xsl:transform>]]></LabelSqlString>
|
|
<LabelTemplate>
|
|
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pe="labelproc" exclude-result-prefixes="pe">
|
|
<xsl:param name="linkOpenType" />
|
|
<xsl:param name="titleLength" />
|
|
<xsl:param name="categoryId" />
|
|
<xsl:param name="hitsType" />
|
|
<xsl:param name="linkUrl" />
|
|
<xsl:output method="html" />
|
|
<xsl:variable name="CategoryCount" select="count(/NewDataSet/Table)"/>
|
|
<xsl:template match="/">
|
|
<li id="C_0">
|
|
<a target="{$linkOpenType}">
|
|
<xsl:attribute name="href">
|
|
<xsl:choose>
|
|
<xsl:when test="$linkUrl = 'Rank.aspx'"><xsl:value-of select="pe:InstallDir()"/>Blog/<xsl:value-of select="$linkUrl"/>?categoryId=0&hitsType=<xsl:value-of select="$hitsType"/></xsl:when>
|
|
<xsl:otherwise><xsl:value-of select="pe:InstallDir()"/>Blog/<xsl:value-of select="$linkUrl"/>?categoryId=0</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:attribute>全部</a>
|
|
</li>
|
|
<xsl:for-each select="/NewDataSet/Table">
|
|
<li id="C_{CategoryID}">
|
|
<a target="{$linkOpenType}">
|
|
<xsl:attribute name="href">
|
|
<xsl:choose>
|
|
<xsl:when test="$linkUrl = 'Rank.aspx'"><xsl:value-of select="pe:InstallDir()"/>Blog/<xsl:value-of select="$linkUrl"/>?categoryId=<xsl:value-of select="CategoryID"/>&hitsType=<xsl:value-of select="$hitsType"/></xsl:when>
|
|
<xsl:otherwise><xsl:value-of select="pe:InstallDir()"/>Blog/<xsl:value-of select="$linkUrl"/>?categoryId=<xsl:value-of select="CategoryID"/></xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:attribute>
|
|
<xsl:value-of select="pe:CutText(CategoryName,$titleLength,'')"/>
|
|
</a>
|
|
</li>
|
|
</xsl:for-each>
|
|
<script type="text/javascript" language="JavaScript">
|
|
function Category(num)
|
|
{
|
|
var arr=new Array;
|
|
arr[0]=0;
|
|
<xsl:for-each select="/NewDataSet/Table">
|
|
arr[<xsl:value-of select="position()"/>]=<xsl:value-of select="CategoryID"/>;
|
|
</xsl:for-each>
|
|
for(var i=0;i<arr.length;i++)
|
|
{
|
|
if(arr[i]==num)
|
|
{
|
|
document.getElementById("C_"+arr[i]).className="on";
|
|
}
|
|
else
|
|
{
|
|
if(i==arr.length-1)
|
|
{
|
|
document.getElementById("C_"+arr[i]).className="lastOne";
|
|
}
|
|
else
|
|
{
|
|
document.getElementById("C_"+arr[i]).className="";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Category('<xsl:value-of select="$categoryId"/>');
|
|
</script>
|
|
</xsl:template>
|
|
</xsl:stylesheet>]]></LabelTemplate>
|
|
<attributes>
|
|
<name>outputQty</name>
|
|
<datatype>supersql</datatype>
|
|
<default>50</default>
|
|
<intro>显示栏目数</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>titleLength</name>
|
|
<datatype>int</datatype>
|
|
<default>10</default>
|
|
<intro>标题长度</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>categoryId</name>
|
|
<datatype>int</datatype>
|
|
<default>0</default>
|
|
<intro>栏目ID:默认为0(全部)</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>hitsType</name>
|
|
<datatype>int</datatype>
|
|
<default>7</default>
|
|
<intro>点击排行类型:默认为点击总排行</intro>
|
|
</attributes>
|
|
<attributes>
|
|
<name>linkUrl</name>
|
|
<datatype>string</datatype>
|
|
<default>Rank.aspx</default>
|
|
<intro>目标链接</intro>
|
|
</attributes>
|
|
</root> |