Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the code above in a DWT and what I need is to put in the "X" the number of elements that I have. So the final TemplateRepeatIndex + 1 and it should be in the DWT if it is possible.

Does anyone have an idea?

Thanks in advance.

<ul data-orbit="" class="adapt-story-slider orbit-slides-container" style="height: 521px;">
<!-- TemplateBeginRepeat name="Component.Fields.decoratedGames" -->
    <li data-orbit-slide="headline-@@TemplateRepeatIndex@@" 
<!-- TemplateEndRepeat -->

<div class="orbit-slide-number">
  <span>1</span> of <span> **X** </span>
share|improve this question

I think the best way to do it is to add a C# Fragment or .NET TBB to calculate the number of elements you will be rendering in your DWT and push it in a Package Variable so that you can access it.

<div class="orbit-slide-number">
  <span>1</span> of <span> @@NumberOfElements@@ </span>
share|improve this answer
Yes I'm afraid this is the only solution, but I was wondering if there could be other one in a DWT. Anyway thanks. – ITB Feb 5 '14 at 15:37
As of 2011 SP1 you can use the function "CollectionLength()" in DWT to get your "X":…. Dylan blogged about using it here: – Nickoli Roussakov Feb 5 '14 at 15:45
+1 to Nick's comment, of course CollectionLength() will be a nice DWT solution – Eric Huiza Feb 5 '14 at 16:03
@NickoliRoussakov: please post your comment as a separate answer. – Frank van Puffelen Feb 5 '14 at 20:34
The question is tagged with 2009. My answer is for 2011 SP1. – Nickoli Roussakov Feb 5 '14 at 20:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.