Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Currently I am using the following 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. Is there anyway to get it to work for all pages?
What is your 'first page' and the structure of 'subsequent page' nodes?Is the blog roll outputting the other links on 'subsequent pages' successfully?What's the entire xslt?
That should help sort it ;)
This is the entire XSLT file that I moded from Blog4Umbraco to show blog posts on a page.
On page 1, it works fine by showing ads under post 3 and 12. I would like the same to happen on page 2, 3, etc.
I haven't used Blog4Umbraco before, but I imagine on the second page the position() you want is actually 18, since it appears to be showing 15 records per page
So something like this might work:
<xsl:if test="position() = (($numberOfPosts * number($pageNumber)) + 3)">...show your ad...</xsl:if>
<xsl:if test="position() = 3 + ($numberOfPosts * number($pageNumber - 1))"><!-- YOUR #3 AD --></xsl:if><xsl:if test="position() = 12 + ($numberOfPosts * number($pageNumber - 1))"><!-- YOUR #12 AD --></xsl:if>
Hope that helps ;)
I added a couple of spaces in the PageNumber item but it works perfectly. Thanks.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted