Providing access to custom list item templates

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.

More ideas as they “come to mind”;

Allow a given list item template to be cloned and modified as needed, whilst remaining in the list of available list item templates

This is about the sidebar and the lists that appear in Open and Recent tabs.

Based on something you said elsewhere, I can tell you and I have a similar workflow when it comes to the story and the sidebar. Mine contain a close button X and an edit button (pen/quill). The edit button is needed both for efficiency and because …

I have tiddlers tagged with $:/tag/non-story. I’ve modified the core Open tab code to exclude those tiddlers from the story – so I need a way to open/edit them. In edit mode they’re allowed in the story.

Not even sure this makes sense without a picture…

image

You could says it’s like a second story river without the rendering – for $:/ tiddlers rendering is pointless anyway… which makes me wonder if I should make all $:/ implicitly “non-story” without the need for the tag.

So, bringing this back to the topic at hand, there’s definitely a need for a “tiddler maintenance” template like this.

  • That is but one area to change the list-item, but yes, good point.
    • Some list items need to be “open in story aware”, or in fact in other lists, and click to remove.
  • What happens when you X an item in the Non-story? just remove them from the story where they are not displayed?

I expect you may want to open $:/ControlPanel and $:/AdvancedSearch

  • I have a simple workaround, create ControlPanel containing {{$:/ControlPanel}}

image

tm-close-tiddler

I modified the Advanced search to have edit icons, too (if they’re non-story result, no sense sending them only to the non-story list, they’re opened for editing directly).