Search results not showing caption instead of title

Many moons ago, I asked a quastion about the caption not appearing in lists instead of the title. This was answered through an edit to $:/core/macros/list tiddler by @EricShulman .

However, today I noticed that search results are similarly not displaying the caption instead of title when a caption has been added to a tiddler. I have been looking through the core tiddlers but can not find where this should be edited.

Can someone tell me how to change this behaviour please.

bobj

The default search results output is defined in this shadow tiddler: $:/core/ui/DefaultSearchResultList

To make an alternative that shows the tiddler captions (with fallback to the title for tiddlers that don’t have a caption), try this:

  • Start by cloning $:/core/ui/DefaultSearchResultList
  • Edit the clone and give it a title such as “$:/custom/ui/SearchResultsWithCaptions”
  • Find this line (which occurs TWICE):
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
  • Replace both occurences with:
<div class="tc-menu-list-item">
<$link><$transclude field="caption"><$view field="title"/></$transclude></$link>
</div>
  • Change the tiddler’s caption to something like “Captions”

After you change this modified cloned tiddler, a new “Captions” tab will appear when using the SideBar search. Select this tab to see your alternative output that uses captions.

enjoy,
-e

3 Likes

Thanks @EricShulman and apologies for tardy reply