# Shortcode with dynamic data variable

**URL:** <https://discourse.gohugo.io/t/shortcode-with-dynamic-data-variable/17751>\
**Category:** Uncategorized\
**Created:** [March 25, 2019, 1:36am UTC](https://discourse.gohugo.io/t/shortcode-with-dynamic-data-variable/17751 "2019-03-25T01:36:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eekoggi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/eekoggi/32/8205_2.png) [@Eekoggi](https://discourse.gohugo.io/u/Eekoggi)\
**Post date:** [March 25, 2019, 1:36am UTC](https://discourse.gohugo.io/t/shortcode-with-dynamic-data-variable/17751/1 "2019-03-25T01:36:40Z")

</div>

I have a shortcode which is iterating over some data. I want to make invocation of data dynamically.

**index.md**  
—  
path: “path\_to\_file” // for another aproach  
—

```
`{{% shortcode-example path="path_to_file" %}}`

```

**shortcode-example.html**

```
{{ $path := .Get "path" }}
{{ $data := index .Site.Data }}
{{ range $data.[variable_data] }}

```

I guess that I can pass path to the data through params of shortcode and after .Get it. Or via .Params of .md file if possible, how can I solve it?
