Take the 2-minute tour ×
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It's 100% free, no registration required.

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@@" 
    </li>
<!-- TemplateEndRepeat -->
</ul>

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

1 Answer

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>
</div>
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. –  Tomé Feb 5 at 15:37
7  
As of 2011 SP1 you can use the function "CollectionLength()" in DWT to get your "X": code.google.com/p/tridion-practice/wiki/…. Dylan blogged about using it here: tridiondeveloper.com/tag/dreamweaver-templating –  Nickoli Roussakov Feb 5 at 15:45
    
+1 to Nick's comment, of course CollectionLength() will be a nice DWT solution –  Eric Huiza Feb 5 at 16:03
1  
@NickoliRoussakov: please post your comment as a separate answer. –  Frank van Puffelen Feb 5 at 20:34
1  
The question is tagged with 2009. My answer is for 2011 SP1. –  Nickoli Roussakov Feb 5 at 20:35
add comment

Your Answer

 
discard

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.