From 0e88a3b72e1acf812fbca44dce31cdafb43b416e Mon Sep 17 00:00:00 2001 From: Graham Reynolds Date: Sun, 13 Jul 2025 22:11:08 +1000 Subject: [PATCH 1/7] Documented optional glue/oxford comma --- content/collections/modifiers/ampersand_list.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/collections/modifiers/ampersand_list.md b/content/collections/modifiers/ampersand_list.md index aa200673c..5d898a13c 100644 --- a/content/collections/modifiers/ampersand_list.md +++ b/content/collections/modifiers/ampersand_list.md @@ -13,6 +13,8 @@ related_entries: --- Turn a simple array into a comma delimited string with a friendly little ampersand between the last two items. +The default can be changed from an ampersand to any string, and a second parameter for an an oxford comma. + ```yaml fruits: - apples @@ -24,14 +26,20 @@ fruits: ::tab antlers ```antlers {{ fruits | ampersand_list }} +{{ fruits | ampersand_list('+') }} +{{ fruits | ampersand_list('+', true) }} ``` ::tab blade ```blade {{ Statamic::modify($fruits)->ampersandList() }} +{{ Statamic::modify($fruits)->ampersandList('+') }} +{{ Statamic::modify($fruits)->ampersandList(['+', true]) }} ``` :: ```html apples, bananas & jerky +apples, bananas + jerky +apples, bananas, + jerky ``` \ No newline at end of file From b5f00d01e2bb06d5144fb1dc2eda9f34c3b03231 Mon Sep 17 00:00:00 2001 From: Graham Reynolds Date: Tue, 15 Jul 2025 15:06:26 +1000 Subject: [PATCH 2/7] Adding attributes to mailto --- content/collections/modifiers/mailto.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/collections/modifiers/mailto.md b/content/collections/modifiers/mailto.md index 95d63a796..f56b5dcdb 100644 --- a/content/collections/modifiers/mailto.md +++ b/content/collections/modifiers/mailto.md @@ -17,13 +17,19 @@ holler: holler@example.com ::tab antlers ```antlers {{ holler | mailto }} +{{ holler | mailto('class:text-white bg-brown') }} +{{ holler | mailto('class:text-white', 'data-tracking:true') }} ``` ::tab blade ```blade {{ Statamic::modify($holler)->mailto() }} +{{ Statamic::modify($holler)->mailto('class:text-white') }} +{{ Statamic::modify($holler)->mailto('class:text-white', 'data-tracking:true') }} ``` :: ```html holler@example.com +holler@example.com +holler@example.com ``` From ea8acb758e7bbc117780bd4ad11d5aac2387a809 Mon Sep 17 00:00:00 2001 From: Graham Reynolds Date: Tue, 15 Jul 2025 20:39:17 +1000 Subject: [PATCH 3/7] Able to change the title on link modifier --- content/collections/modifiers/link.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/collections/modifiers/link.md b/content/collections/modifiers/link.md index 8d8dd7d8a..de4e6b8f9 100644 --- a/content/collections/modifiers/link.md +++ b/content/collections/modifiers/link.md @@ -17,13 +17,19 @@ neat_site: http://example.com ::tab antlers ```antlers {{ neat_site | link }} +{{ neat_site | link('title:Visit my site!') }} +{{ neat_site | link('class:awesome-link') }} ``` ::tab blade ```blade {{ Statamic::modify($neat_site)->link() }} +{{ Statamic::modify($neat_site)->link('title:Visit my site!') }} +{{ Statamic::modify($neat_site)->link('class:awesome-link') }} ``` :: ```html http://example.com -``` +Visit my site! +http://example.com +``` \ No newline at end of file From 6eb10d3a32395286009cc7db28739dd9761c6aa6 Mon Sep 17 00:00:00 2001 From: Graham Reynolds Date: Tue, 15 Jul 2025 21:04:29 +1000 Subject: [PATCH 4/7] Should output unescaped HTML --- content/collections/modifiers/link.md | 6 +++--- content/collections/modifiers/mailto.md | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/content/collections/modifiers/link.md b/content/collections/modifiers/link.md index de4e6b8f9..25b010d13 100644 --- a/content/collections/modifiers/link.md +++ b/content/collections/modifiers/link.md @@ -22,9 +22,9 @@ neat_site: http://example.com ``` ::tab blade ```blade -{{ Statamic::modify($neat_site)->link() }} -{{ Statamic::modify($neat_site)->link('title:Visit my site!') }} -{{ Statamic::modify($neat_site)->link('class:awesome-link') }} +{!! Statamic::modify($neat_site)->link() !!} +{!! Statamic::modify($neat_site)->link('title:Visit my site!') !!} +{!! Statamic::modify($neat_site)->link('class:awesome-link') !!} ``` :: diff --git a/content/collections/modifiers/mailto.md b/content/collections/modifiers/mailto.md index f56b5dcdb..053ba904e 100644 --- a/content/collections/modifiers/mailto.md +++ b/content/collections/modifiers/mailto.md @@ -22,9 +22,9 @@ holler: holler@example.com ``` ::tab blade ```blade -{{ Statamic::modify($holler)->mailto() }} -{{ Statamic::modify($holler)->mailto('class:text-white') }} -{{ Statamic::modify($holler)->mailto('class:text-white', 'data-tracking:true') }} +{!! Statamic::modify($holler)->mailto() !!} +{!! Statamic::modify($holler)->mailto('class:text-white') !!} +{!! Statamic::modify($holler)->mailto('class:text-white', 'data-tracking:true') !!} ``` :: @@ -32,4 +32,4 @@ holler: holler@example.com holler@example.com holler@example.com holler@example.com -``` +``` \ No newline at end of file From 83ab794ac4ff997e12f28bf16a7a75bec343dea0 Mon Sep 17 00:00:00 2001 From: Graham Reynolds Date: Tue, 15 Jul 2025 21:10:30 +1000 Subject: [PATCH 5/7] Can add attributes to img tags --- content/collections/modifiers/image.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/collections/modifiers/image.md b/content/collections/modifiers/image.md index 61e644833..2aeb9a4eb 100644 --- a/content/collections/modifiers/image.md +++ b/content/collections/modifiers/image.md @@ -18,12 +18,15 @@ header_image: /assets/img/bokeh-bunnies.jpg ::tab antlers ```antlers {{ header_image | image }} +{{ header_image | image('class:width-50') }} ``` ::tab blade ```blade {!! Statamic::modify($header_image)->image() !!} +{!! Statamic::modify($header_image)->image('class:width-50') !!} ``` :: ```html + ``` From 3cb4145b69ea64ee8292c9475565e5025f404d9a Mon Sep 17 00:00:00 2001 From: Graham Reynolds Date: Tue, 15 Jul 2025 22:26:02 +1000 Subject: [PATCH 6/7] Ampersand list just uses the same params as sentence list --- content/collections/modifiers/ampersand_list.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/content/collections/modifiers/ampersand_list.md b/content/collections/modifiers/ampersand_list.md index 5d898a13c..27bd61435 100644 --- a/content/collections/modifiers/ampersand_list.md +++ b/content/collections/modifiers/ampersand_list.md @@ -13,7 +13,9 @@ related_entries: --- Turn a simple array into a comma delimited string with a friendly little ampersand between the last two items. -The default can be changed from an ampersand to any string, and a second parameter for an an oxford comma. +:::tip +`ampersand_list` and [Sentence List](/modifiers/sentence_list) share functionality so things like setting the glue and/or oxford comma work the same in both modifiers. +::: ```yaml fruits: @@ -26,20 +28,14 @@ fruits: ::tab antlers ```antlers {{ fruits | ampersand_list }} -{{ fruits | ampersand_list('+') }} -{{ fruits | ampersand_list('+', true) }} ``` ::tab blade ```blade {{ Statamic::modify($fruits)->ampersandList() }} -{{ Statamic::modify($fruits)->ampersandList('+') }} -{{ Statamic::modify($fruits)->ampersandList(['+', true]) }} ``` :: ```html apples, bananas & jerky -apples, bananas + jerky -apples, bananas, + jerky ``` \ No newline at end of file From 9fac9ae5f8ccca6afb9448a2ddd67b183952f38b Mon Sep 17 00:00:00 2001 From: Graham Reynolds Date: Wed, 16 Jul 2025 19:40:25 +1000 Subject: [PATCH 7/7] Explained what attributes can be passed when creating lists --- content/collections/modifiers/dl.md | 13 ++++++++++++- content/collections/modifiers/ol.md | 13 ++++++++++++- content/collections/modifiers/ul.md | 13 ++++++++++++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/content/collections/modifiers/dl.md b/content/collections/modifiers/dl.md index 82da1c1c3..3af391614 100644 --- a/content/collections/modifiers/dl.md +++ b/content/collections/modifiers/dl.md @@ -5,9 +5,20 @@ modifier_types: - array - markup title: DL +related_entries: + - 327f4a3b-04d4-4069-881a-fe50ddb9be23 + - 85910466-876b-4fc7-9dd1-c9baa7f7870a --- Turn a key/value array, otherwise known as a YAML mapping, into an HTML definition list. +:::hot tip +`dl` accepts colon delimited key:value pairs to pass attributes to the `
` element; you cannot pass attributes to the `
`or `
`> elements. + +```antlers +{{ food | dl('class:green', 'disabled:') }} +``` +::: + ```yaml food: Delicious: @@ -40,4 +51,4 @@ food:
broccoli
kale
-``` +``` \ No newline at end of file diff --git a/content/collections/modifiers/ol.md b/content/collections/modifiers/ol.md index a491fd4f0..cecaad88e 100644 --- a/content/collections/modifiers/ol.md +++ b/content/collections/modifiers/ol.md @@ -5,9 +5,20 @@ modifier_types: - array - markup title: OL +related_entries: + - fbdb7bf5-ac19-444c-9536-57332ffff388 + - 85910466-876b-4fc7-9dd1-c9baa7f7870a --- Turn an array into an HTML ordered list element. +:::hot tip +`ol` accepts colon delimited key:value pairs to pass HTML attributes to the `
    ` element; you cannot pass attributes to individual `
  1. ` elements. + +```antlers +{{ food | ol('class:dessert', 'disabled:') }} +``` +::: + ```yaml food: - sushi @@ -33,4 +44,4 @@ food:
  2. broccoli
  3. kale
-``` +``` \ No newline at end of file diff --git a/content/collections/modifiers/ul.md b/content/collections/modifiers/ul.md index e36c109fc..08d563f3a 100644 --- a/content/collections/modifiers/ul.md +++ b/content/collections/modifiers/ul.md @@ -5,9 +5,20 @@ modifier_types: - array - markup title: UL +related_entries: + - fbdb7bf5-ac19-444c-9536-57332ffff388 + - 327f4a3b-04d4-4069-881a-fe50ddb9be23 --- Turn an array into an HTML unordered list element. +:::hot tip +`ul` accepts colon delimited key:value pairs to pass HTML attributes to the `
    ` element; you cannot pass attributes to individual `
  • ` elements. + +```antlers +{{ food | ul('class:style-circle', 'disabled:') }} +``` +::: + ```yaml food: - sushi @@ -33,4 +44,4 @@ food:
  • broccoli
  • kale
-``` +``` \ No newline at end of file