From 965bd090a905f5756e79124b698c894f7f72ad5b Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Sat, 5 Nov 2022 09:10:31 +0000 Subject: [PATCH] list-links macro: add "field" parameter See https://talk.tiddlywiki.org/t/choosing-what-field-to-show-with-list-links/5039?u=jeremyruston --- core/wiki/macros/list.tid | 12 ++++++------ editions/tw5.com/tiddlers/macros/ListMacro.tid | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/wiki/macros/list.tid b/core/wiki/macros/list.tid index 2856f3c32..6b6a32b10 100644 --- a/core/wiki/macros/list.tid +++ b/core/wiki/macros/list.tid @@ -1,21 +1,21 @@ title: $:/core/macros/list tags: $:/tags/Macro -\define list-links(filter,type:"ul",subtype:"li",class:"",emptyMessage) +\define list-links(filter,type:"ul",subtype:"li",class:"",emptyMessage,field:"caption") \whitespace trim -<$type$ class="$class$"> +<$genesis $type=<<__type__>> class=<<__class__>>> <$list filter="$filter$" emptyMessage=<<__emptyMessage__>>> -<$subtype$> +<$genesis $type=<<__subtype__>>> <$link to={{!!title}}> <$let tv-wikilinks="no"> -<$transclude field="caption"> +<$transclude field=<<__field__>>> <$view field="title"/> - + - + \end \define list-links-draggable-drop-actions() diff --git a/editions/tw5.com/tiddlers/macros/ListMacro.tid b/editions/tw5.com/tiddlers/macros/ListMacro.tid index 7ee39ee12..21eb169dc 100644 --- a/editions/tw5.com/tiddlers/macros/ListMacro.tid +++ b/editions/tw5.com/tiddlers/macros/ListMacro.tid @@ -1,6 +1,6 @@ caption: list-links created: 20140917083515996 -modified: 20190206000000000 +modified: 20221105090835041 tags: Macros [[Core Macros]] title: list-links Macro type: text/vnd.tiddlywiki @@ -15,6 +15,8 @@ Note: Each first [[step|Filter Step]] of a [[filter run|Filter Run]] not given a ;filter : A [[filter|Filters]] selecting which tiddlers to include +;caption +: The name of the field to transclude for each list item, defaultingt to `caption` ;type : An HTML element to use for the overall list element, defaulting to `ul` ;subtype