# Shortcodes in shortcode definition

**URL:** https://discourse.gohugo.io/t/shortcodes-in-shortcode-definition/41000
**Category:** support
**Tags:** shortcodes
**Created:** [October 18, 2022, 10:31am UTC](https://discourse.gohugo.io/t/shortcodes-in-shortcode-definition/41000 "2022-10-18T10:31:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jbarossitrs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jbarossitrs/32/16270_2.png) [@jbarossitrs](https://discourse.gohugo.io/u/jbarossitrs)
#### Post date: [October 18, 2022, 10:31am UTC](https://discourse.gohugo.io/t/shortcodes-in-shortcode-definition/41000/1 "2022-10-18T10:31:35Z")

</div>

There are several threads here covering [nested shortcodes](https://gohugo.io/templates/shortcode-templates/#nested-shortcode-image-gallery) but it’s still unclear to me if this provides actual nesting.

To clarify, the example in the docs allows you to pass shortcode2 as input to shortcode1 when including shortcode1 in your normal markdown content. This ability to pipe the output of one shortcode into another is useful for composition on the fly.

However, what it does not seem to allow is including shortcode2.md in the definition of shortcode1.md such as:

```auto
## myFunction is really cool
You can use myFunction with {{% productnames/ExampleMcExampleface %}} to do cool things

```

This is something that would be very useful for content reuse (or for including product names that might change during a rebrand).

The best solution I can find is [hugo - Use shortcode within definition of shortcode - Stack Overflow](https://stackoverflow.com/a/73353588/2992309) but I’d rather not split reusable content between my shortcodes and partials.

Is there a less hacky way to do this?

---

<div class="post-metadata">

### Author: ![jbarossitrs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jbarossitrs/32/16270_2.png) [@jbarossitrs](https://discourse.gohugo.io/u/jbarossitrs)
#### Post date: [October 18, 2022, 12:44pm UTC](https://discourse.gohugo.io/t/shortcodes-in-shortcode-definition/41000/2 "2022-10-18T12:44:02Z")

</div>

After a bit more digging I found [Using shortcode code1.html within an other shortcode code2.html](https://discourse.gohugo.io/t/using-shortcode-code1-html-within-an-other-shortcode-code2-html/16639) which seems to confirm this is not possible and the content I want to reuse in multiple shortcodes needs to be added as partials.
