1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 02:19:55 +00:00

Add emptyMessage parameter to list-links and list-tagged-draggable macros

This commit is contained in:
Jermolene 2018-01-09 17:13:45 +00:00
parent 3b34f60b90
commit b4c7c59d5d
3 changed files with 14 additions and 9 deletions

View File

@ -1,9 +1,9 @@
title: $:/core/macros/list
tags: $:/tags/Macro
\define list-links(filter,type:"ul",subtype:"li",class:"")
\define list-links(filter,type:"ul",subtype:"li",class:"",emptyMessage)
<$type$ class="$class$">
<$list filter="$filter$">
<$list filter="$filter$" emptyMessage=<<__emptyMessage__>>>
<$subtype$>
<$link to={{!!title}}>
<$transclude field="caption">
@ -69,9 +69,9 @@ tags: $:/tags/Macro
</$set>
\end
\define list-tagged-draggable(tag,itemTemplate,elementTag:"div")
\define list-tagged-draggable(tag,emptyMessage,itemTemplate,elementTag:"div")
<$set name="tag" value="""$tag$""">
<$list filter="[<tag>tagging[]]">
<$list filter="[<tag>tagging[]]" emptyMessage=<<__emptyMessage__>>>
<$elementTag$ class="tc-menu-list-item">
<$droppable actions=<<list-tagged-draggable-drop-actions>>>
<$elementTag$ class="tc-droppable-placeholder">

View File

@ -1,8 +1,9 @@
created: 20140917083515996
modified: 20150221223214000
title: list-links Macro
tags: Macros [[Core Macros]]
caption: list-links
created: 20140917083515996
modified: 20180109171310659
tags: Macros [[Core Macros]]
title: list-links Macro
type: text/vnd.tiddlywiki
The <<.def list-links>> [[macro|Macros]] returns a formatted list of links to a [[selection of tiddlers|Title Selection]].
@ -18,5 +19,7 @@ If a tiddler has a <<.field caption>> field, this is shown instead of the tiddle
: An HTML element to use for each item in the list, defaulting to `li`
;class
: A [[CSS|Cascading Style Sheets]] class for the overall list element
;emptyMessage
: Optional wikitext to display if there are no tiddlers with the specified tag
<<.macro-examples "list-links">>

View File

@ -1,6 +1,6 @@
caption: list-tagged-draggable
created: 20170329092723939
modified: 20170329093247470
modified: 20180109171254045
tags: Macros [[Core Macros]]
title: list-tagged-draggable Macro
type: text/vnd.tiddlywiki
@ -13,6 +13,8 @@ The <<.def list-tagged-draggable>> [[macro|Macros]] renders the tiddlers with a
: The title of the tag
;itemTemplate
: 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
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.