Developer forum

Forum » Templates » Is it possible to count Paragraph inside a content area?

Is it possible to count Paragraph inside a content area?

Kim Søjborg Pedersen
Reply

I need to be able to count the items in my bootstrap carousel so I can make the indicators. I reuse the soultionset so my slider items is made with items. Any suggestions?

 

 
    <ol class="carousel-indicators">
        <li data-target="#carousel-example-generic" data-slide-to="0" class=""></li>
        <li data-target="#carousel-example-generic" data-slide-to="1" class=""></li>
        <li data-target="#carousel-example-generic" data-slide-to="2" class=""></li>
    </ol>
 
    <div class="carousel-inner dwcontent" id="sliderInnerWrapper" title="Slider wrapper">
          <!-- DW generated content area -->
    </div>
 
 

 


Replies

 
Mikkel Ricky
Reply

See this post for suggestions on how to count the number of paragraphs: http://developer.dynamicweb-cms.com/forum/templates/templates/number-of-paragraphs.aspx

 

However, it may be a better approach to use an item list for the images in your carousel, i.e. having a Carousel item with Carousel Item items inside. See http://items.dynamicweb.dk/ for an example and check out the item types on Github:

Best regards,
Mikkel

 

You must be logged in to post in the forum