diff --git a/core/wiki/macros/list.tid b/core/wiki/macros/list.tid index d4b0b0a0c..b78ca88e0 100644 --- a/core/wiki/macros/list.tid +++ b/core/wiki/macros/list.tid @@ -22,7 +22,7 @@ tags: $:/tags/Macro <$action-listops $tiddler=<> $field=<> $subfilter="+[insertbefore,]"/> \end -\define list-links-draggable(tiddler,field:"list",emptyMessage,type:"ul",subtype:"li",class:"",itemTemplate) +\define list-links-draggable(tiddler,field:"list",emptyMessage,type:"ul",subtype:"li",class:"",itemTemplate, displayField:"caption") \whitespace trim <$set name="_tiddler" value="""$tiddler$""" emptyValue=<> > <$let field-reference={{{ [<_tiddler>] "!!" [[$field$]] +[join[]] }}} @@ -42,7 +42,7 @@ tags: $:/tags/Macro <$transclude tiddler="""$itemTemplate$"""> <$link to={{!!title}}> <$let tv-wikilinks="no"> - <$transclude field="caption"> + <$transclude field=<<__displayField__>>> <$view field="title"/> @@ -92,7 +92,7 @@ tags: $:/tags/Macro \end -\define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div",storyview:"") +\define list-tagged-draggable(tag,subFilter,emptyMessage,itemTemplate,elementTag:"div",storyview:"",displayField:"") \whitespace trim <$set name="tag" value=<<__tag__>>> @@ -110,6 +110,11 @@ tags: $:/tags/Macro <$genesis $type=<<__elementTag__>>> <$transclude tiddler="""$itemTemplate$"""> <$link to={{!!title}}> + <$let tv-wikilinks="no"> + <$transclude field=<<__displayField__>>> + <$view field="title"/> + + <$view field="title"/> diff --git a/editions/tw5.com/tiddlers/macros/list-links-draggable Macro.tid b/editions/tw5.com/tiddlers/macros/list-links-draggable Macro.tid index cd4252d07..c4bf42da2 100644 --- a/editions/tw5.com/tiddlers/macros/list-links-draggable Macro.tid +++ b/editions/tw5.com/tiddlers/macros/list-links-draggable Macro.tid @@ -31,6 +31,10 @@ The <<.def list-links-draggable>> [[macro|Macros]] renders the ListField of a ti ; itemTemplate : Optional title of a tiddler to use as the template for rendering list items +;displayField +: Optional name of the field to display when the list is rendered. Defaults to the "caption" field; if "caption" is not present, the "title" field is used instead + + If the `itemTemplate` parameter is not provided then the list items are rendered as simple links. Within the `itemTemplate`, the [[currentTiddler Variable]] refers to the current list item. <<.macro-examples "list-links-draggable">> diff --git a/editions/tw5.com/tiddlers/macros/list-tagged-draggable Macro.tid b/editions/tw5.com/tiddlers/macros/list-tagged-draggable Macro.tid index b0e4bbbed..3cb9fb7ee 100644 --- a/editions/tw5.com/tiddlers/macros/list-tagged-draggable Macro.tid +++ b/editions/tw5.com/tiddlers/macros/list-tagged-draggable Macro.tid @@ -17,6 +17,9 @@ The <<.def list-tagged-draggable>> [[macro|Macros]] renders the tiddlers with a : Optional title of a tiddler to use as the template for rendering list items ;emptyMessage : Optional wikitext to display if there are no tiddlers with the specified tag +Here’s a corrected and polished version of your sentence in clear, standard English: +;displayField +: Optional name of the field to display when the list is rendered. Defaults to `title` field. Note that the [[ordering|Order of Tagged Tiddlers]] is accomplished by assigning a new list to the `list` field of the tag tiddler. Any `list-before` or `list-after` fields on any of the other tiddlers carrying the tag are also removed to ensure the `list` field is respected. diff --git a/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9177 b/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9177 new file mode 100644 index 000000000..257e06308 --- /dev/null +++ b/editions/tw5.com/tiddlers/releasenotes/5.4.0/#9177 @@ -0,0 +1,12 @@ +title: $:/changenotes/5.4.0/#9177 +description: Add Display Field to list-tagged-draggable and list-links-draggable +release: 5.4.0 +tags: $:/tags/ChangeNote +change-type: enhancement +change-category: usability +github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9177 +github-contributors: kookma + +A new input parameter, `displayField`, has been added to the `list-links-draggable` and `list-tagged-draggable` macros, +allowing users to specify which field (e.g., title, caption, or any custom field) should be displayed when a tiddler is +rendered via the draggable macro.