aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/content/en/functions/isset.md
blob: 0a8de736739bec35c438a3947984a3b2d02ada0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
title: isset
description: Returns true if the parameter is set.
categories: [functions]
menu:
  docs:
    parent: functions
keywords: []
signature: ["isset COLLECTION INDEX", "isset COLLECTION KEY"]
relatedfuncs: []
---

Takes either a slice, array, or channel and an index or a map and a key as input.

```go-html-template
{{ if isset .Params "project_url" }} {{ index .Params "project_url" }}{{ end }}
```

{{% note %}}
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 configuration key with `.Site.Params.myParam` *or* `.Site.Params.myparam`, for example, when using [`with`](/functions/with).
This restriction also applies when accessing page-level front matter keys from within [shortcodes](/content-management/shortcodes/).
{{% /note %}}