1--- 2title: Shortcode Variables 3linktitle: Shortcode Variables 4description: Shortcodes can access page variables and also have their own specific built-in variables. 5date: 2017-03-12 6publishdate: 2017-03-12 7lastmod: 2017-03-12 8categories: [variables and params] 9keywords: [shortcodes] 10draft: false 11menu: 12 docs: 13 parent: "variables" 14 weight: 20 15weight: 20 16sections_weight: 20 17aliases: [] 18toc: false 19--- 20 21[Shortcodes][shortcodes] have access to parameters delimited in the shortcode declaration via [`.Get`][getfunction], page- and site-level variables, and also the following shortcode-specific fields: 22 23.Name 24: Shortcode name. 25 26.Ordinal 27: Zero-based ordinal in relation to its parent. If the parent is the page itself, this ordinal will represent the position of this shortcode in the page content. 28 29.Parent 30: provides access to the parent shortcode context in nested shortcodes. This can be very useful for inheritance of common shortcode parameters from the root. 31 32.Position 33: Contains [filename and position](https://godoc.org/github.com/gohugoio/hugo/common/text#Position) for the shortcode in a page. Note that this can be relatively expensive to calculate, and is meant for error reporting. See [Error Handling in Shortcodes](/templates/shortcode-templates/#error-handling-in-shortcodes). 34 35 36 37 38.IsNamedParams 39: boolean that returns `true` when the shortcode in question uses [named rather than positional parameters][shortcodes] 40 41.Inner 42: represents the content between the opening and closing shortcode tags when a [closing shortcode][markdownshortcode] is used 43 44[getfunction]: /functions/get/ 45[markdownshortcode]: /content-management/shortcodes/#shortcodes-with-markdown 46[shortcodes]: /templates/shortcode-templates/ 47 48 49