A possible community project
The default list item template in tiddlywiki is contained in $:/core/ui/ListItemTemplate and is very simple;
<div class="tc-menu-list-item"><$link /></div>
This can be modified and other features used, or you can create your own “list item template”.
- You can use the
template="list-item-tiddler"
on the $list widget - or transclude it in the $list widget body
{{||list-item-tiddler}}
- But it can be transuded anywhere to display its result on the current tiddler or a named tiddler
{{||list-item-tiddler}}
. - Or to improve the output of filtered transclusions;
{{{ [tag[Inbox]!tag[done]]||list-item-relativedate}}}
You will see in talk.tiddlywiki.org I have raised related discussions a few times including customising the default list such as in advanced search and other places.
- To get this rolling and seek some input I share the following;
I have just made a quick collection, their names suggest their meaning;
- list-item list item template replacement with tooltip/description
- list-item-and-tags list item template replacement with tooltip/description and tag pills
- list-item-caption list item template replacement with tooltip/description using caption if available
- list-item-code list item template replacement displaying code/text of each tiddler
- list-item-code-render list item template replacement displaying code/text and a render of each tiddler
- list-item-description list item template replacement with tooltip/description using caption if available
- list-item-relativedate list item template replacement with tooltip/description and last modified relative date
- list-item-tag-pills list item template replacement with tooltip/description all as a tag pill even when not a tag
Here is the code of the last one above. For illustration.
<div class="tc-menu-list-item" title=`$(thisTiddler)$: ${ [{!!tooltip}] [[-]] [{!!description}] +[join[ ]] }```
><<tag>></div>
You can see how useful these are, and it would be great if as a community we could build a collection. I am happy to do this, but would love other ideas.
What’s next?
Once a wiki has a set of list items available to it. we want to document them and ideally make them available to the editor on demand. I can see using autocomplete, editor toolbar buttons etc… making this accessible to all.
Question
How do we best provide access to these list-items ?
- to the community I will start here listitemtemplates.tiddlyhost.com
- from a documentation and editing perspective once installed in a given wiki
- How do we quickly lookup and choose a list item template?
This same question could be applied to a range solutions who’s operation requires you provide a parameter/value pair eg; template=list-item-relativedate
or color=red
or any list from which we want to select an item.