在sw中我们在文章内容页有上一篇文章,下一篇文章这样的连接
在sf中我们如何实现这种效果?
下面我们添加两个标签来实现这个效果.
第一步
第二步
第三步
sql语句
SELECT TOP 1 PE_CommonModel.*,PE_U_Article.* FROM PE_CommonModel INNER JOIN PE_U_Article ON PE_CommonModel.ItemID = PE_U_Article.ID WHERE (PE_CommonModel.GeneralID > @itemid) AND PE_CommonModel.Status=99
第四步,标签内容
<?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:output method="html" />
<xsl:param name="itemid" />
<xsl:template match="/">
<xsl:for-each select="/NewDataSet/Table">
<xsl:choose>
<xsl:when test="count(/NewDataSet/Table)=0" >
<ul>
<li>下一篇:没有了</li>
</ul>
</xsl:when>
<xsl:otherwise>
<li>下一篇:
<a> <xsl:attribute name="href">
<xsl:value-of select="pe:GetInfoPath(GeneralID)"/>
</xsl:attribute> <xsl:attribute name="title">
</xsl:attribute>
<xsl:value-of select="Title"/>
</a>
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:transform>
然后点击完成,下一篇文章这个标签就完成了.
同理,我们添加上一篇文章这个标签.
标签第一步
第二步

第三步
sql语句:
SELECT TOP 1 PE_CommonModel.*,PE_U_Article.* FROM PE_CommonModel INNER JOIN PE_U_Article ON PE_CommonModel.ItemID = PE_U_Article.ID WHERE (PE_CommonModel.GeneralID < @itemid) AND PE_CommonModel.Status=99
第四步
标签内容
<?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:output method="html" />
<xsl:param name="itemid" />
<xsl:template match="/">
<xsl:for-each select="/NewDataSet/Table">
<xsl:choose>
<xsl:when test="count(/NewDataSet/Table)=0" >
<ul>
<li>上一篇:没有了</li>
</ul>
</xsl:when>
<xsl:otherwise>
<li>上一篇:
<a> <xsl:attribute name="href">
<xsl:value-of select="pe:GetInfoPath(GeneralID)"/>
</xsl:attribute> <xsl:attribute name="title">
</xsl:attribute>
<xsl:value-of select="Title"/>
</a>
</li>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:transform>
这样上一篇标签页添加完毕.
我们在内容页模板相应位置插入
{PE.Label id="上一篇" itemid="@Request_id" span="" class="" /}
{PE.Label id="下一篇" itemid="@Request_id" span="" class="" /}
即可看到效果.