mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-25 06:43:15 +00:00
Add emptyMessage parameter to list-links and list-tagged-draggable macros
This commit is contained in:
parent
3b34f60b90
commit
b4c7c59d5d
|
@ -1,9 +1,9 @@
|
||||||
title: $:/core/macros/list
|
title: $:/core/macros/list
|
||||||
tags: $:/tags/Macro
|
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$">
|
<$type$ class="$class$">
|
||||||
<$list filter="$filter$">
|
<$list filter="$filter$" emptyMessage=<<__emptyMessage__>>>
|
||||||
<$subtype$>
|
<$subtype$>
|
||||||
<$link to={{!!title}}>
|
<$link to={{!!title}}>
|
||||||
<$transclude field="caption">
|
<$transclude field="caption">
|
||||||
|
@ -69,9 +69,9 @@ tags: $:/tags/Macro
|
||||||
</$set>
|
</$set>
|
||||||
\end
|
\end
|
||||||
|
|
||||||
\define list-tagged-draggable(tag,itemTemplate,elementTag:"div")
|
\define list-tagged-draggable(tag,emptyMessage,itemTemplate,elementTag:"div")
|
||||||
<$set name="tag" value="""$tag$""">
|
<$set name="tag" value="""$tag$""">
|
||||||
<$list filter="[<tag>tagging[]]">
|
<$list filter="[<tag>tagging[]]" emptyMessage=<<__emptyMessage__>>>
|
||||||
<$elementTag$ class="tc-menu-list-item">
|
<$elementTag$ class="tc-menu-list-item">
|
||||||
<$droppable actions=<<list-tagged-draggable-drop-actions>>>
|
<$droppable actions=<<list-tagged-draggable-drop-actions>>>
|
||||||
<$elementTag$ class="tc-droppable-placeholder">
|
<$elementTag$ class="tc-droppable-placeholder">
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
created: 20140917083515996
|
|
||||||
modified: 20150221223214000
|
|
||||||
title: list-links Macro
|
|
||||||
tags: Macros [[Core Macros]]
|
|
||||||
caption: list-links
|
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]].
|
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`
|
: An HTML element to use for each item in the list, defaulting to `li`
|
||||||
;class
|
;class
|
||||||
: A [[CSS|Cascading Style Sheets]] class for the overall list element
|
: 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">>
|
<<.macro-examples "list-links">>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
caption: list-tagged-draggable
|
caption: list-tagged-draggable
|
||||||
created: 20170329092723939
|
created: 20170329092723939
|
||||||
modified: 20170329093247470
|
modified: 20180109171254045
|
||||||
tags: Macros [[Core Macros]]
|
tags: Macros [[Core Macros]]
|
||||||
title: list-tagged-draggable Macro
|
title: list-tagged-draggable Macro
|
||||||
type: text/vnd.tiddlywiki
|
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
|
: The title of the tag
|
||||||
;itemTemplate
|
;itemTemplate
|
||||||
: Optional title of a tiddler to use as the template for rendering list items
|
: 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.
|
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.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user