content: Consolidate configuration documentation

This commit is contained in:
Joe Mooring authored and GitHub committed 2025-03-05 04:50:06 -08:00
1 parent 727ef6f665
commit b6cae5cbc6
911 files changed
+10902 -11171

No files matched your search

@@ -3,18 +3,19 @@ title: IsNamedParams
description: Reports whether the shortcode call uses named arguments.
categories: []
keywords: []
action:
related:
- methods/shortcode/Get
returnType: bool
signatures: [SHORTCODE.IsNamedParams]
params:
functions_and_methods:
related:
- methods/shortcode/Get
returnType: bool
signatures: [SHORTCODE.IsNamedParams]
---
To support both positional and named arguments when calling a shortcode, use the `IsNamedParams` method to determine how the shortcode was called.
With this shortcode template:
{{< code file=layouts/shortcodes/myshortcode.html >}}
{{< code file=layouts/shortcodes/myshortcode.html >}}
{{ if .IsNamedParams }}
{{ printf "%s %s." (.Get "greeting") (.Get "firstName") }}
{{ else }}
@@ -24,7 +25,7 @@ With this shortcode template:
Both of these calls return the same value:
{{< code file=content/about.md lang=md >}}
{{< code file=content/about.md lang=text >}}
{{</* myshortcode greeting="Hello" firstName="world" */>}}
{{</* myshortcode "Hello" "world" */>}}
{{< /code >}}