From c224fadb17051be583dd9b1177ffc130ffdf8987 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sat, 23 Nov 2024 11:16:32 -0800 Subject: [PATCH] Clarify the shortcode Ordinal method Closes #2778 --- content/en/methods/shortcode/Ordinal.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/en/methods/shortcode/Ordinal.md b/content/en/methods/shortcode/Ordinal.md index 6f3580d0fc..41393fa222 100644 --- a/content/en/methods/shortcode/Ordinal.md +++ b/content/en/methods/shortcode/Ordinal.md @@ -11,6 +11,10 @@ action: The `Ordinal` method returns the zero-based ordinal of the shortcode in relation to its parent. If the parent is the page itself, the ordinal represents the position of this shortcode in the page content. +{{% note %}} +Hugo increments the ordinal with each shortcode call, regardless of the specific shortcode type. This means that the ordinal value is tracked sequentially across all shortcodes within a given page. +{{% /note %}} + This method is useful for, among other things, assigning unique element IDs when a shortcode is called two or more times from the same page. For example: {{< code file=content/about.md lang=md >}}