Having puzzled with this for a while, and traversing the forums hasn't helped me coming closer to a solution.
What i have On one page i show some thumbnails of some some magazine covers - this was easy. I use a macro parameter called "maxItems" so that it only shows the first 6 magazine covers. This was piece of cake - so far so good.
What i want On the same page i want to make somekind of "Archive" - where i show magazine number 7, 8, 9 and so on further down the list. but i can't figure this one out! So please help med on this one.
My XSLT for showing the first 6 magazine covers looks like this:
<!-- THE IF, WILL TEST HOW MANY ITEMS TO SHOW --> <xsl:if test="position() <= $maxItems"> <div id="BWnewsMagazine"> <h2> <!-- Month - taken from the node name--> <xsl:value-of select="@nodeName" disable-output-escaping="yes"/>
<!-- Year - taken from the node/folder name--> <xsl:value-of select="../@nodeName" disable-output-escaping="yes"/> </h2>
<!-- THE PHOTO OF THE NEWS MAGAZINE --> <xsl:variable name="englishfile" select="umbraco.library:GetMedia(number(./data[@alias='BWnewsFile']),'false')"/> <a href="{$englishfile/data[@alias='umbracoFile']}"> <img style="border: none;"> <xsl:attribute name="src"> <xsl:value-of select="umbraco.library:GetMedia(data [@alias = 'BWnewsPhoto'], 'false')/data [@alias = 'umbracoFile']"/> </xsl:attribute> </img> </a>
My content tree looks like this:
- Magazine page (where i show the first six AND the archive) -- Year --- Month ---- Magazine Cover
The cover picture and the file (to download) is chosen via Media pickers, if that makes any difference.
<xsl:choose> <xsl:whentest="position() <= $maxItems"> <!-- less than or equal to 6 loop --> </xsl:when> <xsl:whentest="position() > $maxItems"> <!-- greater than 6 loop --> </xsl:when> </xsl:choose>
<xsl:choose> <xsl:whentest="position() <= $maxItems"> <!-- less than or equal to 6 loop --> </xsl:when> <xsl:otherwise> <!-- greater than 6 loop --> </xsl:otherwise> </xsl:choose>
Thanks for your help - i turner out that it was all in all just me being stupid!
I just changed my
<xsl:iftest="position() <= $maxItems">
to
<xsl:iftest="position() >= $maxItems">
And then it worked!
I am sure i had already tried this ">" before, with errors to follow - but apparently the problem then was, that the XSLT made a rendering error, because i only had exactly 6 covers to show - there had to be 7. So thank you Dan, you pointed me in the right direction.
Showing number 7 an onwards
Hi all,
Having puzzled with this for a while, and traversing the forums hasn't helped me coming closer to a solution.
What i have
On one page i show some thumbnails of some some magazine covers - this was easy. I use a macro parameter called "maxItems" so that it only shows the first 6 magazine covers. This was piece of cake - so far so good.
What i want
On the same page i want to make somekind of "Archive" - where i show magazine number 7, 8, 9 and so on further down the list. but i can't figure this one out! So please help med on this one.
My XSLT for showing the first 6 magazine covers looks like this:
My content tree looks like this:
- Magazine page (where i show the first six AND the archive)
-- Year
--- Month
---- Magazine Cover
The cover picture and the file (to download) is chosen via Media pickers, if that makes any difference.
Hope that someone is able to help me out a bit.
br/
Hundebol
Hi There
Hows about just
oops,
or even
Dan
Hi Dan,
Thanks for your help - i turner out that it was all in all just me being stupid!
I just changed my
to
And then it worked!
I am sure i had already tried this ">" before, with errors to follow - but apparently the problem then was, that the XSLT made a rendering error, because i only had exactly 6 covers to show - there had to be 7. So thank you Dan, you pointed me in the right direction.
br/
Hundebol
is working on a reply...