The following solution is the most elegant way to improve the handling of drafts in custom lists;
See the below solution by Eric, the best solution is to use -[get[draft.of]]
to remove original titles also with a draft tiddler.
<$list filter="[tag[$:/tags/SideBar]] -[get[draft.of]]">
</$list>
Background
For example;
<$list filter="[tag[$:/tags/SideBar]]">
</$list>
Will list all tiddlers tagged $:/tags/SideBar
- This includes the original title AND the draft title if one of the above tiddlers is in draft mode;
<$list filter="[tag[$:/tags/SideBar]!has[draft.of]]">
</$list>
Example Result
$:/core/ui/SideBar/Open
TableOfContents
$:/PSaT/bookmarkletMaker/sideBar-list
$:/PSaT/edit-recent/sidebar
$:/PSaT/edit-recent/sidebar-system
$:/PSaT/history-sidebar
Draft of '$:/PSaT/history-sidebar'
- See the last two items they are the same tiddler one in draft.
We can exclude tiddlers with draft using !has[draft.of]
as below.
<$list filter="[tag[$:/tags/SideBar]!has[draft.of]]">
</$list>
- This will exclude draft tiddlers and only list the original title
So is there a simple way that displays the draft tiddler BUT NOT the original tiddler in such lists?
- That is will exclude original title when a matching draft title is in the list.
- Remember there is a possibility of a draft tiddler existing but not in the story
Another way to ask the same question is;
For a given <<currentTiddler>>
how do we test to see if it has a “draft tiddler” existing, so we can exclude <<currentTiddler>>
from the filter result.
Thanks in advance, once I have an answer I will turn this into a How to Instruction!