title: Bootstrap carousel with OS-Class
body: <p>I need to create dynamically bootstrap carousel like this:</p>
  
  <pre><code>&lt;div id="carousel-example-generic" class="carousel slide" data-ride="carousel"&gt;
    &lt;!-- Indicators --&gt;
    &lt;ol class="carousel-indicators"&gt;
      &lt;li data-target="#carousel-example-generic" data-slide-to="0" class="active"&gt;&lt;/li&gt;
      &lt;li data-target="#carousel-example-generic" data-slide-to="1"&gt;&lt;/li&gt;
      etc...
    &lt;/ol&gt;
  
    &lt;!-- Wrapper for slides --&gt;
    &lt;div class="carousel-inner"&gt;
      &lt;div class="item active"&gt;
        &lt;img src="someIMG.jpg" alt="..."&gt;
  
      &lt;/div&gt;
      &lt;div class="item"&gt;
        &lt;img src="someIMG-nn.jpg" alt="..."&gt;
  
      &lt;/div&gt;
      etc...
    &lt;/div&gt;
  
    &lt;!-- Controls --&gt;
    &lt;a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"&gt;
      &lt;span class="glyphicon glyphicon-chevron-left"&gt;&lt;/span&gt;
    &lt;/a&gt;
    &lt;a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"&gt;
      &lt;span class="glyphicon glyphicon-chevron-right"&gt;&lt;/span&gt;
    &lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now I have a osclass functions which I call to create dynamically bootstrap carousel:</p>
  
  <pre><code>**&lt;?php osc_run_hook('item_detail', osc_item() ) ; ?&gt;
                      &lt;?php if( osc_images_enabled_at_items() &amp;&amp; (osc_count_item_resources() &gt; 0) ) { ?&gt;**
  
  &lt;div id="carousel-example-generic" class="carousel slide" data-ride="carousel"&gt;
    &lt;!-- Indicators --&gt;
    &lt;ol class="carousel-indicators"&gt;
  **&lt;?php $i=0;?&gt;**
                              **&lt;?php while( osc_has_item_resources() ) { ?&gt;**
      &lt;li data-target="#carousel-example-generic" data-slide-to="**&lt;?php echo $i; $i+1;?&gt;**" class="active"&gt;&lt;/li&gt;
      **&lt;?php } ?&gt;** 
    &lt;/ol&gt;
  
    &lt;!-- Wrapper for slides --&gt;
    &lt;div class="carousel-inner"&gt;
  **&lt;?php while( osc_has_item_resources() ) { ?&gt;**
      &lt;div class="item"&gt;
        &lt;img src="**&lt;?php echo osc_resource_url(); ?&gt;**" alt="..."&gt;
  
  
      &lt;/div&gt;
      **&lt;?php } ?&gt;** 
  
  
    &lt;/div&gt;
  
    &lt;!-- Controls --&gt;
    &lt;a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"&gt;
      &lt;span class="glyphicon glyphicon-chevron-left"&gt;&lt;/span&gt;
    &lt;/a&gt;
    &lt;a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"&gt;
      &lt;span class="glyphicon glyphicon-chevron-right"&gt;&lt;/span&gt;
    &lt;/a&gt;
  
  
  &lt;/div&gt;
  </code></pre>
  
  <p><strong></strong> </p>
  
  <p>I'm beginner so I don't know what can be a problem here. In my logic I think that I write good but what I write don't work... Two while is the problem or something else?</p>
  
  <p>please help, sorry for my English. THANKS!</p>