I've been using the wonderful PDCalendar control from Peter D, it is a great control! I have been able to customize the XSLT to do everything I want...until know.
I have setup my calendar data using a top level Events Calendar node and organized my events into month-based folders underneath it. I am trying to build a "Coming Soon" macro for my homepage, which displays the next 2 upcoming events within a rolling 30 day period, but am having trouble limiting my results to only 2 events.
I have tried using position() within my for-each statements, but since the events may come from different nodes (i.e. 1 from February and 1 from March) their position values are (I think) relative to their parent folder. What I end up with is 1 event from February and 2 from March, but I really only want 2 total. I've tried using a counter or some kind of tracking method to limit my XLST for-each statements, but XSLT doesn't seem to allow for that.
Does anyone have a suggestion for handling a scenario like this? I would appreciate any insight.
Number of events with PDCalendar
I've been using the wonderful PDCalendar control from Peter D, it is a great control! I have been able to customize the XSLT to do everything I want...until know.
I have setup my calendar data using a top level Events Calendar node and organized my events into month-based folders underneath it. I am trying to build a "Coming Soon" macro for my homepage, which displays the next 2 upcoming events within a rolling 30 day period, but am having trouble limiting my results to only 2 events.
I have tried using position() within my for-each statements, but since the events may come from different nodes (i.e. 1 from February and 1 from March) their position values are (I think) relative to their parent folder. What I end up with is 1 event from February and 2 from March, but I really only want 2 total. I've tried using a counter or some kind of tracking method to limit my XLST for-each statements, but XSLT doesn't seem to allow for that.
Does anyone have a suggestion for handling a scenario like this? I would appreciate any insight.
Thanks,
Jeremy
Hi,
you can use position just fine. Being on different parent-nodes should not matter.
Here's a little example:
HTH,
Peter
is working on a reply...