isset.md (1139B)
1 --- 2 title: isset 3 linktitle: isset 4 description: Returns true if the parameter is set. 5 date: 2017-02-01 6 publishdate: 2017-02-01 7 lastmod: 2017-02-01 8 categories: [functions] 9 menu: 10 docs: 11 parent: "functions" 12 keywords: [] 13 signature: ["isset COLLECTION INDEX", "isset COLLECTION KEY"] 14 workson: [] 15 hugoversion: 16 relatedfuncs: [] 17 deprecated: false 18 aliases: [] 19 --- 20 21 Takes either a slice, array, or channel and an index or a map and a key as input. 22 23 ``` 24 {{ if isset .Params "project_url" }} {{ index .Params "project_url" }}{{ end }} 25 ``` 26 27 {{% warning %}} 28 All site-level configuration keys are stored as lower case. Therefore, a `myParam` key-value set in your [site configuration file](/getting-started/configuration/) needs to be accessed with `{{if isset .Site.Params "myparam"}}` and *not* with `{{if isset .Site.Params "myParam"}}`. Note that you can still access the same config key with `.Site.Params.myParam` *or* `.Site.Params.myparam`, for example, when using [`with`](/functions/with). 29 This restriction also applies when accessing page-level front matter keys from within [shortcodes](/content-management/shortcodes/). 30 {{% /warning %}}