Hi all,
is there some kind of static variable system in the new Hugo version that I could use to create a Bootstrap slider shortcode system? I would want to register a counter in the outer shortcode that receives an increment per child-shortcode and can be used later AFTER the {{ .Inner }}
is processed in the outer shortcode.strong text
Long version:
The final HTML should be:
<div id="carousel" class="carousel slide carousel-fade" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="image.jpg" alt="Third slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="image2.jpg" alt="Second slide">
</div>
...
</div>
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide-to="0" class="active"></li>
<li data-target="#carousel" data-slide-to="1"></li>
...
</ol>
<a class="carousel-control-prev" href="#carousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
In shortcode I would assume:
{{< slideshow parameter="" parameter2="" >}}
{{< slideshowimage url="blabla" >}}
{{< slideshowimage url="blabla" >}}
{{< /slideshow >}}
The .Inner tag would count up a variable per occurance of slideshowimage that I could use for the #carousel-indicators
section which has x items - same amount as the images in the shortcode.