# Statically initialize a shortcode?

**URL:** <https://discourse.gohugo.io/t/statically-initialize-a-shortcode/17202>\
**Category:** support\
**Created:** [February 25, 2019, 12:51am UTC](https://discourse.gohugo.io/t/statically-initialize-a-shortcode/17202 "2019-02-25T00:51:51Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [February 25, 2019, 5:01am UTC](https://discourse.gohugo.io/t/statically-initialize-a-shortcode/17202/3 "2019-02-25T05:01:47Z")

</div>

I had the same issue once and if you are using multiple different shortcodes that won’t need the script you might want to look into `.Ordinal` or the solution by @brunoamaral.

> [@"Static Variable" that increments through shortcodes?](https://discourse.gohugo.io/t/static-variable-that-increments-through-shortcodes/14120):
>
> 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…

---

_[View the full topic](https://discourse.gohugo.io/t/statically-initialize-a-shortcode/17202)._
