Using Position() in a blog roll to work on every page
Currently I am using the follow开发者_如何学Cing xslt code:
<xsl:if test="position() = 3">
<div>
<object data="/frontpage_blogroll_center_top_728x90" type="text/html" width="735" height="95" style="overflow:hidden; width: 738px; height: 100px"><xsl:comment /></object>
</div>
</xsl:if>
I'm using "position() = 3" to position an ad in a blog roll, it works for the first page but not for the subsequent pages. (IE ?page=2 ?page=3 etc) Is there anyway to get it to work for all pages?
<xsl:if test="position() = 3 + ($numberOfPosts * number($pageNumber - 1))">
<div>
<object data="/frontpage_blogroll_center_top_728x90" type="text/html" width="735" height="95" style="overflow:hidden; width: 738px; height: 100px"><xsl:comment /></object>
</div>
</xsl:if>
Just wanted to post the answer
精彩评论